Basic synchronization primitives for use inside one process.
More...
Basic synchronization primitives for use inside one process.
CMRX offers mutual exclusive access facilities for userspace processes. There is an implementation of futex (fast userspace mutex) available and supported. There is also an implementation of mutex (driven by kernel), but this might get deprecated anytime soon.
◆ FUTEX_FAILURE
◆ FUTEX_STATIC_INIT
#define FUTEX_STATIC_INIT { 0xFF, 0, 0 } |
Compile time initialization of futex.
If futex is initialized using this value, then it is not necessary to call futex_init() during runtime.
◆ FUTEX_SUCCESS
◆ MUTEX_INITIALIZED
#define MUTEX_INITIALIZED 1 |
◆ mutex_t
◆ futex_destroy()
int futex_destroy |
( |
futex_t * |
futex | ) |
|
◆ futex_init()
int futex_init |
( |
futex_t *restrict |
futex | ) |
|
Futexes Futex is fast userspace mutex.
Advantage of futex over mutex is, that it can be locked and unlocked completely from userspace. Futexes can be shared safely between threads of single process, yet can't be normally shared between threads of multiple processes unless explicitly placed into shared memory region.
◆ futex_lock()
◆ futex_trylock()
int futex_trylock |
( |
futex_t * |
futex | ) |
|
◆ futex_unlock()
int futex_unlock |
( |
futex_t * |
futex | ) |
|