|
Anklang-0.3.0.dev956+gd75ac925 anklang-0.3.0.dev956+gd75ac925
ASE — Anklang Sound Engine (C++)
« « « Anklang Documentation |
Multi-producer, multi-consumer stack for non-reclaimable memory nodes. More...
#include "atomics.hh"
Public Member Functions | |
| bool | empty () const |
| bool | push (Node *node) |
| Node * | pop () |
| Node * | peek () |
Multi-producer, multi-consumer stack for non-reclaimable memory nodes.
Multiple producers can push and multiple consumers can pop nodes concurrently, but no thread may still be in calls to push/pop during destruction and the stack has to be empty for destruction. Nodes need to provide a nullptr-initialized intrusive .intr_ptr_ pointer member to be pushed and must stay readable during the stack lifetime. The push() and pop() methods are lock free but not wait free and synchronize through the same memory cell, so for lots of clients they can easily become the single bottleneck.
Definition at line 95 of file atomics.hh.
| Ase::MpmcStack< Node >::MpmcStack | ( | ) |
Definition at line 97 of file atomics.hh.
| Ase::MpmcStack< Node >::~MpmcStack | ( | ) |
Definition at line 105 of file atomics.hh.
| bool Ase::MpmcStack< Node >::empty | ( | ) | const |
Definition at line 119 of file atomics.hh.
| Node * Ase::MpmcStack< Node >::peek | ( | ) |
Definition at line 160 of file atomics.hh.
| Node * Ase::MpmcStack< Node >::pop | ( | ) |
Definition at line 141 of file atomics.hh.
| bool Ase::MpmcStack< Node >::push | ( | Node * | node | ) |
Definition at line 125 of file atomics.hh.