|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Modern synchronization helpers for channels, shared state, and small producer-consumer queues. More...
#include <atomic>#include <condition_variable>#include <concepts>#include <cstddef>#include <deque>#include <functional>#include <mutex>#include <optional>#include <shared_mutex>#include <stdexcept>#include <type_traits>#include <utility>#include <vector>#include <thread_pool.H>Go to the source code of this file.
Classes | |
| class | Aleph::BoundedChannel< T > |
| Bounded blocking channel for producer-consumer workflows. More... | |
| class | Aleph::Synchronized< T, Mutex > |
| Mutex-protected shared object wrapper. More... | |
| class | Aleph::Synchronized< T, Mutex >::LockedPtr |
| RAII guard for exclusive access to the synchronized value. More... | |
| class | Aleph::Synchronized< T, Mutex >::ConstLockedPtr |
| RAII guard for read-only access to the synchronized value. More... | |
| class | Aleph::RwSynchronized< T, SharedMutex > |
| Read/write-lock protected shared object wrapper. More... | |
| class | Aleph::RwSynchronized< T, SharedMutex >::ReadLockedPtr |
| RAII guard for shared (read-only) access. More... | |
| class | Aleph::RwSynchronized< T, SharedMutex >::WriteLockedPtr |
| RAII guard for exclusive (write) access. More... | |
| class | Aleph::SpscQueue< T > |
| Bounded single-producer/single-consumer queue. More... | |
Namespaces | |
| namespace | Aleph |
| Main namespace for Aleph-w library functions. | |
Typedefs | |
| template<typename T > | |
| using | Aleph::bounded_channel = BoundedChannel< T > |
| Alias for Aleph::BoundedChannel. | |
| template<typename T , typename Mutex = std::mutex> | |
| using | Aleph::synchronized = Synchronized< T, Mutex > |
| Alias for Aleph::Synchronized. | |
| template<typename T , typename SharedMutex = std::shared_mutex> | |
| using | Aleph::rw_synchronized = RwSynchronized< T, SharedMutex > |
| Alias for Aleph::RwSynchronized. | |
| template<typename T > | |
| using | Aleph::spsc_queue = SpscQueue< T > |
| Alias for Aleph::SpscQueue. | |
Modern synchronization helpers for channels, shared state, and small producer-consumer queues.
This header complements thread_pool.H with a few focused utilities for practical concurrent code:
These facilities intentionally keep a small API surface. They are suitable for everyday coordination tasks and can be combined with ThreadPool, TaskGroup, and the parallel algorithms introduced in earlier phases.
Example:
For legacy POSIX wrappers see useMutex.H and useCondVar.H. New code should generally prefer this header together with standard C++ mutexes and condition variables.
BoundedChannel also offers overloads that accept Aleph::CancellationToken. These preserve the same close semantics but throw Aleph::operation_canceled if cancellation is requested while a sender or receiver is blocked waiting for space or data.
Definition in file concurrency_utils.H.