|
Corium 1.1.0
High-Performance Zero-Heap C++20 MPSC Application Runtime
|
Lock-free Multiple-Producer, Single-Consumer (MPSC) RingBuffer. Implements Dmitry Vyukov's algorithm with zero heap allocations (uses std::array). Cache-line aligned (alignas(CORIUM_CACHE_LINE_SIZE)) to eliminate false sharing. More...
#include <MpscRingBuffer.hpp>
Inheritance diagram for corium::MpscRingBuffer< T, Capacity >:
Collaboration diagram for corium::MpscRingBuffer< T, Capacity >:Classes | |
| struct | PushResult |
Public Member Functions | |
| bool | empty () const noexcept |
| Check if the queue is empty (approximate if concurrent producers are active). | |
| MpscRingBuffer () | |
| MpscRingBuffer (const MpscRingBuffer &)=delete | |
| MpscRingBuffer (MpscRingBuffer &&)=delete | |
| MpscRingBuffer & | operator= (const MpscRingBuffer &)=delete |
| MpscRingBuffer & | operator= (MpscRingBuffer &&)=delete |
| bool | tryPop (T &result) |
| Pop an item from the queue (Single-Consumer only). | |
| template<typename... Args> | |
| PushResult | tryPush (Args &&... args) |
| Push an item into the queue (Multi-Producer thread safe). | |
| ~MpscRingBuffer () | |
Static Public Member Functions | |
| static constexpr std::size_t | capacity () noexcept |
| Return fixed capacity of this ring buffer. | |
Lock-free Multiple-Producer, Single-Consumer (MPSC) RingBuffer. Implements Dmitry Vyukov's algorithm with zero heap allocations (uses std::array). Cache-line aligned (alignas(CORIUM_CACHE_LINE_SIZE)) to eliminate false sharing.
| T | Event element type stored in ring cells. |
| Capacity | Buffer capacity (must be a power of 2). |
|
inline |
|
inline |
|
delete |
|
delete |
|
inlinestaticconstexprnoexcept |
Return fixed capacity of this ring buffer.
|
inlinenoexcept |
Check if the queue is empty (approximate if concurrent producers are active).
|
delete |
|
delete |
|
inline |
Pop an item from the queue (Single-Consumer only).
Here is the caller graph for this function:
|
inline |
Push an item into the queue (Multi-Producer thread safe).
Here is the caller graph for this function: