SAM function SAM-My-workid()

From SoOS

Jump to: navigation, search

Contents

[edit] Name

SAM_My_workid - Get calling thread's worker ID

[edit] Synopsis

#include <sam.h>
 
SAM_Workerid_t SAM_My_workid(SAM_t sam);

[edit] Description

The SAM_My_workid() function returns the worker thread ID of the calling worker thread. This function shall only be called from a worker thread, otherwise behavior is undetermined.

[edit] Return value

See DESCRIPTION above.

[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_My_type(), SAM_My_pthreadid(), <sam.h>.