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) |
| |