NewMadeleine

Documentation

« back to PM2 home.
Synchronization primitives using conditions

nm_cond_* functions are used to manage synchronization with & without pioman. More...

static void nm_cond_init (nm_cond_status_t *p_cond, nm_status_t bitmask)
 initialize a nm_cond_status_t object
 
static void nm_cond_destroy (nm_cond_status_t *p_cond)
 free resources associated with a nm_cond_status_t object
 
static nm_status_t nm_cond_test (const nm_cond_status_t *p_cond, nm_status_t bitmask)
 test whether the given bit is set in the status; unlocked, weak consistency
 
static nm_status_t nm_cond_test_locked (const nm_cond_status_t *p_cond, nm_status_t bitmask)
 test whether the given bit is set in the status; locked, guaranteed consistency, slower
 
static void nm_cond_add (nm_cond_status_t *p_cond, nm_status_t bitmask)
 add a bit to the bitmask in the status, do not unlock waiters (for bits that will not be waited for)
 
static void nm_cond_wait (nm_cond_status_t *p_cond, nm_status_t bitmask, nm_core_t p_core)
 wait for the given bit to be set in the status; do active polling while waiting
 
static void nm_cond_signal (nm_cond_status_t *p_cond, nm_status_t bitmask)
 add a bit and wake up threads waiting for it
 
static void nm_cond_wait_all (void **pp_conds, int n, uintptr_t offset, nm_status_t bitmask, nm_core_t p_core)
 wait on multiple statuses at the same time
 
static void nm_cond_destroy (nm_cond_status_t *p_cond __attribute__((unused)))
 
static void nm_cond_mask (nm_cond_status_t *p_cond, nm_status_t bitmask)
 

Detailed Description

nm_cond_* functions are used to manage synchronization with & without pioman.

They are used internally for request status but may be used by endusers for synchronization with monitor handlers

Function Documentation

◆ nm_cond_add()

static void nm_cond_add ( nm_cond_status_t p_cond,
nm_status_t  bitmask 
)
inlinestatic

add a bit to the bitmask in the status, do not unlock waiters (for bits that will not be waited for)

Definition at line 737 of file nm_core_interface.h.

Referenced by nm_status_add().

◆ nm_cond_destroy() [1/2]

static void nm_cond_destroy ( nm_cond_status_t *p_cond   __attribute__(unused))
inlinestatic

Definition at line 723 of file nm_core_interface.h.

◆ nm_cond_destroy() [2/2]

static void nm_cond_destroy ( nm_cond_status_t p_cond)
inlinestatic

free resources associated with a nm_cond_status_t object

Referenced by nm_status_destroy().

◆ nm_cond_init()

static void nm_cond_init ( nm_cond_status_t p_cond,
nm_status_t  bitmask 
)
inlinestatic

initialize a nm_cond_status_t object

Examples
nm_bench_req_monitor.c.

Definition at line 718 of file nm_core_interface.h.

Referenced by nm_status_init().

◆ nm_cond_mask()

static void nm_cond_mask ( nm_cond_status_t p_cond,
nm_status_t  bitmask 
)
inlinestatic

Definition at line 742 of file nm_core_interface.h.

Referenced by nm_status_unset().

◆ nm_cond_signal()

static void nm_cond_signal ( nm_cond_status_t p_cond,
nm_status_t  bitmask 
)
inlinestatic

add a bit and wake up threads waiting for it

Examples
nm_bench_req_monitor.c.

Definition at line 747 of file nm_core_interface.h.

Referenced by nm_status_signal().

◆ nm_cond_test()

static nm_status_t nm_cond_test ( const nm_cond_status_t p_cond,
nm_status_t  bitmask 
)
inlinestatic

test whether the given bit is set in the status; unlocked, weak consistency

Definition at line 727 of file nm_core_interface.h.

Referenced by nm_cond_test_locked(), nm_cond_wait(), and nm_status_test().

◆ nm_cond_test_locked()

static nm_status_t nm_cond_test_locked ( const nm_cond_status_t p_cond,
nm_status_t  bitmask 
)
inlinestatic

test whether the given bit is set in the status; locked, guaranteed consistency, slower

Definition at line 732 of file nm_core_interface.h.

References nm_cond_test().

Referenced by nm_status_test().

Here is the call graph for this function:

◆ nm_cond_wait()

static void nm_cond_wait ( nm_cond_status_t p_cond,
nm_status_t  bitmask,
nm_core_t  p_core 
)
inlinestatic

wait for the given bit to be set in the status; do active polling while waiting

Examples
nm_bench_req_monitor.c.

Definition at line 752 of file nm_core_interface.h.

References nm_cond_test(), and nm_schedule().

Referenced by nm_cond_wait_all(), and nm_status_wait().

Here is the call graph for this function:

◆ nm_cond_wait_all()

static void nm_cond_wait_all ( void **  pp_conds,
int  n,
uintptr_t  offset,
nm_status_t  bitmask,
nm_core_t  p_core 
)
inlinestatic

wait on multiple statuses at the same time

Definition at line 760 of file nm_core_interface.h.

References nm_cond_wait().

Referenced by nm_status_wait_all().

Here is the call graph for this function: