SAM function SAM-Execution-create()
From SoOS
Contents |
[edit] Name
SAM_Execution_create - Create a worker thread
[edit] Synopsis
#include <sam.h> SAM_Workerid_t SAM_Execution_create(SAM_t sam, void *(*start_routine)(void*), void *arg);
[edit] Description
The SAM_Execution_create() is used to create a new worker thread within a process and the SAM Structure object sam. The worker thread is created executing start_routine with arg as its sole argument.
[edit] Return value
Upon completion SAM_Execution_create() returns the unique identifier of the new created worker thread.
[edit] Errors
None, assumes correct input parameters.
[edit] Examples
Example 1 - Creating a basic worker thread
Example 2 - Sending and retrieving information to worker threads
Example 3 A - Executing speculatively and flashing back a worker thread (inefficient version)
Example 3 B - Executing speculatively and flashing back a worker thread (efficient version)
Example 4 - Executing speculatively, flashing back, and speculative writing
Example 5 - Using multiple protected memory regions within the same SAM context
[edit] See also
SAM_Execution_join(), SAM_Execution_start(), SAM_Execution_finish(), SAM_Execution_restart(), SAM_Execution_cancel(), <sam.h>.