Deque that is lock-free only when used by a single producer and consumer, otherwise contention is split between front and back locks.
More...
|
| | SpscDeque (szt size=0, const T &initVal=T(), const Alloc &alloc=Alloc()) |
| |
| | ~SpscDeque () |
| |
| void | resize (szt size, const T &initVal=T()) |
| | Resize the deque to contain a number of elements. More...
|
| |
| template<class T_ > |
| void | push_front (T_ &&val) |
| | Insert new element constructed with val at the beginning of the list. More...
|
| |
| template<class T_ > |
| void | push_back (T_ &&val) |
| | Add new element constructed with val onto the end of the list. More...
|
| |
| bool | pop_front (optional< T & > val=optnull) |
| | Pop element from the beginning of the list and move it into val. Returns true on success, false if there is no element to pop. More...
|
| |
| bool | pop_back (optional< T & > val=optnull) |
| | Pop element from the end of the list and move it into val. Returns true on success, false if there is no element to pop. More...
|
| |
| void | clear () |
| | Remove all elements. More...
|
| |
| szt | size () const |
| | Number of elements in deque. More...
|
| |
| bool | empty () const |
| | Check whether the deque does not contain any elements. More...
|
| |
template<class T, class Alloc_ = typename DefaultAllocator<T>::type>
class honey::lockfree::SpscDeque< T, Alloc_ >
Deque that is lock-free only when used by a single producer and consumer, otherwise contention is split between front and back locks.
Automatically expands storage size as needed (requires lock).
Internally maintains a ring-buffer (traversing from head to tail may loop around end of buffer).