rlib
Convenience library for useful things
Loading...
Searching...
No Matches
Concurrency

Atomics, threads, threadpools and task queues - the concurrency-flavoured building blocks the rest of rlib uses for thread-safe data structures, deferred work and parallel execution. More...

Modules

 Atomic operations
 Sequentially-consistent load / store / exchange / CAS / fetch-modify operations on three atomic-friendly types (raint, rauint, raptr), plus a raboolean alias for the int variant.
 
 Task queue
 Deferred-work queue: callers enqueue RTask objects with optional dependencies, worker threads owned by the queue pick them up and run them to completion.
 
 Thread pool
 Worker pool where every thread runs the same entry function with a shared common argument plus a per-thread specific argument.
 
 One-shot initialisation
 Run an init function exactly once across all threads, with a cheap fast path on every subsequent call.
 
 Threads, locks and condition variables
 OS-thread spawning, mutex / RW-mutex / condition-variable primitives, and thread-specific storage.
 

Detailed Description

Atomics, threads, threadpools and task queues - the concurrency-flavoured building blocks the rest of rlib uses for thread-safe data structures, deferred work and parallel execution.

Four sub-areas:

Atomics underpin the refcount in r_ref and the hazard-pointer machinery in r_hzrptr, so the dependency direction is concurrency primitives -> data structures -> higher subsystems.