__gnu_parallel::_RestrictedBoundedConcurrentQueue(3cxx)

__gnu_parallel::_RestrictedBoundedConcurrentQueue3cxx

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.

Usage

#include <queue.h>

Public Member Functions

_RestrictedBoundedConcurrentQueue (_SequenceIndex __max_size)
Constructor. Not to be called concurrent, of course. ~_RestrictedBoundedConcurrentQueue ()
Destructor. Not to be called concurrent, of course. bool pop_back (_Tp &__t)
Pops one element from the queue at the front end. Must not be called concurrently with pop_front(). bool pop_front (_Tp &__t)
Pops one element from the queue at the front end. Must not be called concurrently with pop_front(). void push_front (const _Tp &__t)
Pushes one element into the queue at the front end. Must not be called concurrently with pop_front().

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

_Tp Contained element type.

Constructor & Destructor Documentation

template<typename _Tp > __gnu_parallel::_RestrictedBoundedConcurrentQueue< _Tp >::_RestrictedBoundedConcurrentQueue (_SequenceIndex __max_size) [inline]

Constructor. Not to be called concurrent, of course.

Parameters

__max_size Maximal number of elements to be contained.

References __gnu_parallel::__encode2().

template<typename _Tp > __gnu_parallel::_RestrictedBoundedConcurrentQueue< _Tp >::~_RestrictedBoundedConcurrentQueue () [inline]

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().

References __gnu_parallel::__compare_and_swap(), __gnu_parallel::__decode2(), and __gnu_parallel::__encode2().

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().

References __gnu_parallel::__compare_and_swap(), __gnu_parallel::__decode2(), and __gnu_parallel::__encode2().

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().

References __gnu_parallel::__decode2(), __gnu_parallel::__encode2(), and __gnu_parallel::__fetch_and_add().

Releases

7 releases since Debian 7 (Wheezy); the text changed 6 times.

  1. 7
  2. 8
  3. 9
  4. 10
  5. 11
  6. 12
  7. 13

Author

Generated automatically by Doxygen for libstdc++ from the source code.

From libstdc++-12-doc 12.4.0-5 in Debian 13 (Trixie). Also shipped by libstdc++-13-doc, libstdc++-14-doc. Parsed by carta from the page's man source.