---
name: "__gnu_parallel::_RestrictedBoundedConcurrentQueue"
section: "3"
platform: "linux"
package: "gcc"
version: "16.2.1+r23+gd564253eb6c8-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/__gnu_parallel::_RestrictedBoundedConcurrentQueue"
---

# \_\_gnu\_parallel::\_RestrictedBoundedConcurrentQueue(3)

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.

## NAME

\_\_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.

## SYNOPSIS

\#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()**.

## Author

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