Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »


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.

 

sleep(uint64_t ns)

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

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();     
}                                      

 

 

 

  • No labels