SAM function SAM-Execution-join()
From SoOS
Contents |
[edit] Name
SAM_Execution_join - Join the execution of a worker thread
[edit] Synopsis
#include <sam.h> void * SAM_Execution_join(SAM_t sam, SAM_Workerid_t wid);
[edit] Description
The SAM_Execution_join() function suspends execution of the calling thread until the target worker thread terminates, unless the target worker thread has already terminated. When a SAM_Execution_join() returns successfully, the target worker thread has been terminated. The results of multiple simultaneous calls to SAM_Execution_join() specifying the same target worker thread within the same SAM Structure object sam are undefined. If the thread calling SAM_Execution_join() is canceled, then the worker threads will not be detached.
[edit] Return value
On return from SAM_Execution_join() call, the value returned by the terminating worker thread is returned by SAM_Execution_join().
[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_create(), SAM_Execution_start(), SAM_Execution_finish(), SAM_Execution_restart(), SAM_Execution_cancel(), <sam.h>.