CppCommon
1.0.4.1
C++ Common Library
|
Multiple producers / single consumer wait-free linked queue. More...
#include <mpsc_linked_queue.h>
Public Member Functions | |
MPSCLinkedQueue () | |
MPSCLinkedQueue (const MPSCLinkedQueue &)=delete | |
MPSCLinkedQueue (MPSCLinkedQueue &&)=delete | |
~MPSCLinkedQueue () | |
MPSCLinkedQueue & | operator= (const MPSCLinkedQueue &)=delete |
MPSCLinkedQueue & | operator= (MPSCLinkedQueue &&)=delete |
bool | Enqueue (const T &item) |
Enqueue an item into the linked queue (multiple producers threads method) More... | |
bool | Enqueue (T &&item) |
Enqueue an item into the linked queue (multiple producers threads method) More... | |
bool | Dequeue (T &item) |
Dequeue an item from the linked queue (single consumer thread method) More... | |
Multiple producers / single consumer wait-free linked queue.
Multiple producers / single consumer wait-free linked queue use only atomic operations to provide thread-safe enqueue and dequeue operations. Linked queue is a dynamically grows queue which allocates memory for each new node.
FIFO order is guaranteed!
Thread-safe.
C++ implementation of Dmitry Vyukov's non-intrusive lock free unbound MPSC queue http://www.1024cores.net/home/lock-free-algorithms/queues/non-intrusive-mpsc-node-based-queue
Definition at line 32 of file mpsc_linked_queue.h.
|
inline |
Definition at line 12 of file mpsc_linked_queue.inl.
|
delete |
|
delete |
|
inline |
Definition at line 24 of file mpsc_linked_queue.inl.
|
inline |
Dequeue an item from the linked queue (single consumer thread method)
The item will be moved from the linked queue.
Will not block.
item | - Item to dequeue |
Definition at line 62 of file mpsc_linked_queue.inl.
|
inline |
Enqueue an item into the linked queue (multiple producers threads method)
The item will be copied into the linked queue.
Will not block.
item | - Item to enqueue |
Definition at line 36 of file mpsc_linked_queue.inl.
|
inline |
Enqueue an item into the linked queue (multiple producers threads method)
The item will be moved into the linked queue.
Will not block.
item | - Item to enqueue |
Definition at line 43 of file mpsc_linked_queue.inl.
|
delete |
|
delete |