Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
|
Multiple Producer Multiple Consumer lock-free queue. More...
#include <src/utils/mpmc_queue.h>
Public Member Functions | |
MPMCQueue (size_t buffer_size=8) | |
size_t | capacity () const |
void | reserve (size_t buffer_size) |
void | clear () |
bool | push_back (T const &data) |
bool | pop_front (T &data) |
Static Public Member Functions | |
static size_t | power_of_two_size (size_t sz) |
Multiple Producer Multiple Consumer lock-free queue.
See https://gist.github.com/x42/9aa5e737a1479bafb7f1bb96f7c64dc0
This is taken from Ardour.
Inspired by http://www.1024cores.net/home/lock-free-algorithms/queues/bounded-mpmc-queue Kudos to Dmitry Vyukov who licensed that code in terms of a 2-clause BSD license.
TODO: maybe replace with https://github.com/erez-strauss/lockfree_mpmc_queue or https://github.com/rigtorp/MPMCQueue/blob ?
Definition at line 66 of file mpmc_queue.h.
|
inline |
Definition at line 69 of file mpmc_queue.h.
Definition at line 71 of file mpmc_queue.h.
|
inline |
Definition at line 73 of file mpmc_queue.h.
|
inline |
Definition at line 97 of file mpmc_queue.h.
|
inline |
Definition at line 141 of file mpmc_queue.h.
|
inlinestatic |
Definition at line 75 of file mpmc_queue.h.
|
inline |
Definition at line 107 of file mpmc_queue.h.
|
inline |
Definition at line 83 of file mpmc_queue.h.