Arachne  0.1
Public Member Functions | Public Attributes | List of all members
Arachne::ThreadInvocation< F > Struct Template Reference

#include <Arachne.h>

Inheritance diagram for Arachne::ThreadInvocation< F >:
Inheritance graph
[legend]

Public Member Functions

 ThreadInvocation (F mainFunction)
 
void runThread ()
 

Public Attributes

mainFunction
 The top-level function of the Arachne thread.
 

Detailed Description

template<typename F>
struct Arachne::ThreadInvocation< F >

This structure is used during thread creation to pass the function and arguments for the new thread's top-level function from a creating thread to the core that runs the new thread. It also ensures that the arguments will fit in a single cache line, since they will be stored in a single cache line.

Template Parameters
FThe type of the return value of std::bind, which is a value type of unspecified class.

This wrapper enables us to bypass the dynamic memory allocation that is sometimes performed by std::function.

Constructor & Destructor Documentation

template<typename F >
Arachne::ThreadInvocation< F >::ThreadInvocation ( mainFunction)
inlineexplicit

Construct a threadInvocation from the type that is returned by std::bind.

Member Function Documentation

template<typename F >
void Arachne::ThreadInvocation< F >::runThread ( )
inlinevirtual

This is invoked exactly once for each Arachne thread to begin its execution.

Implements Arachne::ThreadInvocationEnabler.


The documentation for this struct was generated from the following file: