Library of Assembled Shared Sources
lass::stde::lock_free_queue< T, FixedAllocator > Class Template Reference

Non-blocking, lock-free FIFO data structure. More...

#include <lock_free_queue.h>

Inheritance diagram for lass::stde::lock_free_queue< T, FixedAllocator >:

Public Member Functions

void push (const value_type &x)
 push a value in the back
 
void push (value_type &&x)
 push a value in the back
 
template<class... Args>
void emplace (Args &&... args)
 emplace a value in the back
 
bool pop (value_type &x)
 Try to pop a value from the front and store it in x.
 

Detailed Description

template<typename T, typename FixedAllocator = util::AllocatorFixed<util::AllocatorMalloc>>
class lass::stde::lock_free_queue< T, FixedAllocator >

Non-blocking, lock-free FIFO data structure.

M. M. Michael, M. L. Scott, "Simple, Fast, and Practical Non-Blocking and Blocking Concurrent Queue Algorithms", Proc. of the 15th Annual ACM Symposium on Principles of Distributed Computing (PODC' 96), New York, USA, pp. 267-275 (1996).

Definition at line 68 of file lock_free_queue.h.

Member Function Documentation

◆ push()

template<typename T, typename A>
void lass::stde::lock_free_queue< T, A >::push ( const value_type & x)

push a value in the back

  • exception safe: if no node of could be allocatoed, or if copy constructor of x throws, it fails gracefully.

Definition at line 92 of file lock_free_queue.inl.

References push().

Referenced by push(), and push().

◆ pop()

template<typename T, typename A>
bool lass::stde::lock_free_queue< T, A >::pop ( value_type & x)

Try to pop a value from the front and store it in x.

Returns
false if no element could be popped.

Definition at line 127 of file lock_free_queue.inl.

References pop().

Referenced by pop().


The documentation for this class was generated from the following files: