createThread(int coreId, _Callable&& __f, _Args&&... __args)
At the moment, this function takes a core ID, a function, and a set of arguments for the function, and then schedules the thread to run on the target core at the next available opportunity.
...
This function operates like nanosleep by relinquishing control of the thread for at least `ns` nanoseconds.
threadInit()
This function must be called before any other calls to the Arachne library, and initializes state for managing threads.
Sample Arachne Application
Code Block |
---|
int main(int argc, char** argv){
// Initialize the library
Arachne::threadInit();
// Add some work
Arachne::createThread(0, producer);
Arachne::createThread(1, consumer);
fflush(stdout);
// Must be the last call
Arachne::mainThreadJoinPool();
}
|