Anklang 0.3.0-460-gc4ef46ba
ASE — Anklang Sound Engine (C++)

« « « Anklang Documentation
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
Ase::MpmcStack< Node > Struct Template Reference

#include "atomics.hh"

Public Member Functions

bool empty () const
 
bool push (Node *node)
 
Node * pop ()
 
Node * peek ()
 

Detailed Description

template<typename Node>
struct Ase::MpmcStack< Node >

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 96 of file atomics.hh.

Constructor & Destructor Documentation

◆ MpmcStack()

template<typename Node >
Ase::MpmcStack< Node >::MpmcStack ( )

Definition at line 98 of file atomics.hh.

◆ ~MpmcStack()

template<typename Node >
Ase::MpmcStack< Node >::~MpmcStack ( )

Definition at line 106 of file atomics.hh.

Member Function Documentation

◆ empty()

template<typename Node >
bool Ase::MpmcStack< Node >::empty ( ) const

Definition at line 120 of file atomics.hh.

◆ peek()

template<typename Node >
Node * Ase::MpmcStack< Node >::peek ( )

Definition at line 161 of file atomics.hh.

◆ pop()

template<typename Node >
Node * Ase::MpmcStack< Node >::pop ( )

Definition at line 142 of file atomics.hh.

◆ push()

template<typename Node >
bool Ase::MpmcStack< Node >::push ( Node *  node)

Definition at line 126 of file atomics.hh.


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