xenium
|
A fast unbounded lock-free multi-producer/multi-consumer FIFO queue. More...
#include <ramalhete_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... | |
A fast unbounded lock-free multi-producer/multi-consumer FIFO queue.
This is an implementation of the FAAArrayQueue
by Ramalhete and Correia [Ram16].
It is faster and more efficient than the michael_scott_queue
, but less generic as 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). Note: std::unique_ptr
are supported for convinience, but custom deleters are not yet supported.
A generic version that does not have this limitation is planned for a future version.
Supported policies:
xenium::policy::reclaimer
xenium::policy::backoff
xenium::no_backoff
)xenium::policy::entries_per_node
xenium::policy::pop_retries
T | |
Policies | list of policies to customize the behaviour |
void xenium::ramalhete_queue< T, Policies >::push | ( | value_type | value | ) |
Pushes the given value to the queue.
This operation might have to allocate a new node. Progress guarantees: lock-free (may perform a memory allocation)
value |
bool xenium::ramalhete_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