#include <CircularQueue.h>
This is a lock-free (but not wait-free) multi-producer multi-consumer implementation of a circular queue matching the ThreadAccessPolicy of CircularQueue.
- Note
- maxCapacity parameters MUST always be a power of 2.
|
| ManyThreadsPerEnd () |
|
bool | isEmpty (unsigned maxSize) const |
|
bool | isFull (unsigned maxSize) const |
|
unsigned | size (unsigned maxSize) const |
|
void | init (AtomicInt array[], int maxCapacity) |
|
bool | push (AtomicInt array[], int maxSize, int maxCapacity, const AtomicInt &item) |
|
bool | pop (AtomicInt array[], int maxSize, int maxCapacity, AtomicInt &item, bool clear=true) |
|
unsigned | skip (AtomicInt array[], int maxSize, int maxCapacity, unsigned outmaxsize, bool clear=true) |
|
template<class OutputIterator > |
unsigned | pop (AtomicInt array[], int maxSize, int maxCapacity, OutputIterator out, unsigned outmaxsize, bool clear=true) |
|
◆ head
AtomicInt sofa::helper::system::thread::ManyThreadsPerEnd::head |
|
protected |
◆ tail
AtomicInt sofa::helper::system::thread::ManyThreadsPerEnd::tail |
|
protected |
◆ ManyThreadsPerEnd()
SOFA_HELPER_API sofa::helper::system::thread::ManyThreadsPerEnd::ManyThreadsPerEnd |
( |
| ) |
|
|
inlineprotected |
◆ init()
SOFA_HELPER_API void sofa::helper::system::thread::ManyThreadsPerEnd::init |
( |
AtomicInt |
array[], |
|
|
int |
maxCapacity |
|
) |
| |
|
inlineprotected |
◆ isEmpty()
SOFA_HELPER_API bool sofa::helper::system::thread::ManyThreadsPerEnd::isEmpty |
( |
unsigned |
maxSize | ) |
const |
|
inlineprotected |
◆ isFull()
SOFA_HELPER_API bool sofa::helper::system::thread::ManyThreadsPerEnd::isFull |
( |
unsigned |
maxSize | ) |
const |
|
inlineprotected |
◆ pop() [1/2]
SOFA_HELPER_API bool sofa::helper::system::thread::ManyThreadsPerEnd::pop |
( |
AtomicInt |
array[], |
|
|
int |
maxSize, |
|
|
int |
maxCapacity, |
|
|
AtomicInt & |
item, |
|
|
bool |
clear = true |
|
) |
| |
|
inlineprotected |
◆ pop() [2/2]
template<class OutputIterator >
unsigned sofa::helper::system::thread::ManyThreadsPerEnd::pop |
( |
AtomicInt |
array[], |
|
|
int |
maxSize, |
|
|
int |
maxCapacity, |
|
|
OutputIterator |
out, |
|
|
unsigned |
outmaxsize, |
|
|
bool |
clear = true |
|
) |
| |
|
protected |
◆ push()
SOFA_HELPER_API bool sofa::helper::system::thread::ManyThreadsPerEnd::push |
( |
AtomicInt |
array[], |
|
|
int |
maxSize, |
|
|
int |
maxCapacity, |
|
|
const AtomicInt & |
item |
|
) |
| |
|
inlineprotected |
◆ size()
SOFA_HELPER_API unsigned sofa::helper::system::thread::ManyThreadsPerEnd::size |
( |
unsigned |
maxSize | ) |
const |
|
inlineprotected |
◆ skip()
SOFA_HELPER_API unsigned sofa::helper::system::thread::ManyThreadsPerEnd::skip |
( |
AtomicInt |
array[], |
|
|
int |
maxSize, |
|
|
int |
maxCapacity, |
|
|
unsigned |
outmaxsize, |
|
|
bool |
clear = true |
|
) |
| |
|
inlineprotected |