Skip to content

Struct Ase::MpmcStack

template <typename Node>

ClassList > Ase > MpmcStack

More...

  • #include <atomics.hh>

Public Functions

Type Name
MpmcStack ()
bool empty () const
Node * peek ()
Node * pop ()
bool push (Node * node)
~MpmcStack ()

Detailed Description

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.

Public Functions Documentation

function MpmcStack

inline Ase::MpmcStack::MpmcStack () 

function empty

inline bool Ase::MpmcStack::empty () const

function peek

inline Node * Ase::MpmcStack::peek () 

function pop

inline Node * Ase::MpmcStack::pop () 

function push

inline bool Ase::MpmcStack::push (
    Node * node
) 

function ~MpmcStack

inline Ase::MpmcStack::~MpmcStack () 


The documentation for this class was generated from the following file /__w/anklang/anklang/ase/atomics.hh