xenium
|
A bounded lock-free multi-producer/multi-consumer k-FIFO queue. More...
#include <kirsch_bounded_kfifo_queue.hpp>
Public Member Functions | |
bool | try_push (value_type value) |
Tries to push a new element to the queue. More... | |
bool | try_pop (value_type &result) |
Tries to pop an element from the queue. More... | |
Static Public Attributes | |
static constexpr std::size_t | entry_size = sizeof(entry) |
Provides the effective size of a single queue entry (including padding). | |
A bounded lock-free multi-producer/multi-consumer k-FIFO queue.
This is an implementation of the proposal by Kirsch et al. [KLP13].
A k-FIFO queue can be understood as a queue where each element may be dequeued out-of-order up to k−1.
A limitation of this queue is that it can only handle pointers or trivially copyable types that are smaller than a pointer (i.e., T
must be a raw pointer, a std::unique_ptr
or a trivially copyable type like std::uint32_t).
Supported policies:
xenium::policy::padding_bytes
sizeof(T*)
)T | |
Policies | list of policies to customize the behaviour |
bool xenium::kirsch_bounded_kfifo_queue< T, Policies >::try_pop | ( | value_type & | result | ) |
Tries to pop an element from the queue.
Progress guarantees: lock-free
result |
true
if the operation was successful, otherwise false
bool xenium::kirsch_bounded_kfifo_queue< T, Policies >::try_push | ( | value_type | value | ) |
Tries to push a new element to the queue.
Progress guarantees: lock-free
value |
true
if the operation was successful, otherwise false