GNU g++  v5.2.1
GNU Standard C++
__gnu_parallel::_RestrictedBoundedConcurrentQueue< _Tp > Class Template Reference

Double-ended queue of bounded size, allowing lock-free atomic access. More...

#include <queue.h>

Collaboration diagram for __gnu_parallel::_RestrictedBoundedConcurrentQueue< _Tp >:

Public Member Functions

 _RestrictedBoundedConcurrentQueue (_SequenceIndex __max_size)
 Constructor. More...
 
 ~_RestrictedBoundedConcurrentQueue ()
 Destructor. More...
 
bool pop_back (_Tp &__t)
 Pops one element from the queue at the front end. More...
 
bool pop_front (_Tp &__t)
 Pops one element from the queue at the front end. More...
 
void push_front (const _Tp &__t)
 Pushes one element into the queue at the front end. More...
 

Private Attributes

_Tp * _M_base
 Array of elements, seen as cyclic buffer. More...
 
volatile _CASable _M_borders
 Cyclic __begin and __end pointers contained in one atomically changeable value. More...
 
_SequenceIndex _M_max_size
 Maximal number of elements contained at the same time. More...
 

Detailed Description

template<typename _Tp>
class __gnu_parallel::_RestrictedBoundedConcurrentQueue< _Tp >

Double-ended queue of bounded size, allowing lock-free atomic access.

push_front() and pop_front() must not be called concurrently to each other, while pop_back() can be called concurrently at all times. empty(), size(), and top() are intentionally not provided. Calling them would not make sense in a concurrent setting.

Parameters
_TpContained element type.

Constructor & Destructor Documentation

Constructor.

Not to be called concurrent, of course.

Parameters
__max_sizeMaximal number of elements to be contained.

Destructor.

Not to be called concurrent, of course.

Member Function Documentation

template<typename _Tp>
bool __gnu_parallel::_RestrictedBoundedConcurrentQueue< _Tp >::pop_back ( _Tp &  __t)
inline

Pops one element from the queue at the front end.

Must not be called concurrently with pop_front().

template<typename _Tp>
bool __gnu_parallel::_RestrictedBoundedConcurrentQueue< _Tp >::pop_front ( _Tp &  __t)
inline

Pops one element from the queue at the front end.

Must not be called concurrently with pop_front().

Referenced by __gnu_parallel::__qsb_local_sort_with_helping().

Here is the caller graph for this function:

template<typename _Tp>
void __gnu_parallel::_RestrictedBoundedConcurrentQueue< _Tp >::push_front ( const _Tp &  __t)
inline

Pushes one element into the queue at the front end.

Must not be called concurrently with pop_front().

Referenced by __gnu_parallel::__qsb_local_sort_with_helping().

Here is the caller graph for this function:

Member Data Documentation

template<typename _Tp>
_Tp* __gnu_parallel::_RestrictedBoundedConcurrentQueue< _Tp >::_M_base
private
template<typename _Tp>
volatile _CASable __gnu_parallel::_RestrictedBoundedConcurrentQueue< _Tp >::_M_borders
private

Cyclic __begin and __end pointers contained in one atomically changeable value.

Referenced by __gnu_parallel::_RestrictedBoundedConcurrentQueue< _Piece >::push_front().


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