Multiple producer consumer, bounded queue Implementation of Dmitry Vyukov's MPMC algorithm http://www.1024cores.net/home/lock-free-algorithms/queues/bounded-mpmc-queue.
More...
#include <ut0mpmcbq.h>
template<typename T>
class mpmc_bq< T >
Multiple producer consumer, bounded queue Implementation of Dmitry Vyukov's MPMC algorithm http://www.1024cores.net/home/lock-free-algorithms/queues/bounded-mpmc-queue.
◆ Aligned
◆ Pad
◆ mpmc_bq() [1/3]
Constructor.
- Parameters
-
[in] | n_elems | Max number of elements allowed |
◆ ~mpmc_bq()
◆ mpmc_bq() [2/3]
◆ mpmc_bq() [3/3]
◆ capacity()
template<typename T >
size_t mpmc_bq< T >::capacity |
( |
| ) |
const |
|
inline |
- Returns
- the capacity of the queue
◆ dequeue()
template<typename T >
bool mpmc_bq< T >::dequeue |
( |
T & |
data | ) |
|
|
inline |
Dequeue an element.
- Parameters
-
[out] | data | Element read from the queue |
- Returns
- true on success
◆ empty()
- Returns
- true if the queue is empty.
◆ enqueue()
template<typename T >
bool mpmc_bq< T >::enqueue |
( |
T const & |
data | ) |
|
|
inline |
Enqueue an element.
- Parameters
-
[in] | data | Element to insert, it will be copied |
- Returns
- true on success
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ m_capacity
template<typename T >
size_t const mpmc_bq< T >::m_capacity |
|
private |
◆ m_dequeue_pos
template<typename T >
std::atomic<size_t> mpmc_bq< T >::m_dequeue_pos |
|
private |
◆ m_enqueue_pos
template<typename T >
std::atomic<size_t> mpmc_bq< T >::m_enqueue_pos |
|
private |
◆ m_pad0
◆ m_pad1
◆ m_pad2
◆ m_pad3
◆ m_ring
The documentation for this class was generated from the following file: