xenium
|
An unbounded lock-free multi-producer/multi-consumer k-FIFO queue. More...
#include <kirsch_kfifo_queue.hpp>
Public Member Functions | |
void | push (value_type value) |
Pushes the given value to the queue. More... | |
bool | try_pop (value_type &result) |
Tries to pop an object 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). | |
An unbounded 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::reclaimer
xenium::policy::padding_bytes
sizeof(T*)
)T | |
Policies | list of policies to customize the behaviour |
void xenium::kirsch_kfifo_queue< T, Policies >::push | ( | value_type | value | ) |
Pushes the given value to the queue.
This operation might have to allocate a new segment. Progress guarantees: lock-free (may perform a memory allocation)
value |
bool xenium::kirsch_kfifo_queue< T, Policies >::try_pop | ( | value_type & | result | ) |
Tries to pop an object from the queue.
Progress guarantees: lock-free
result |
true
if the operation was successful, otherwise false