parallel-cellular-automata
Framework for building parallel cellular automata.
|
work-stealing queue. More...
#include <queues.hpp>
Public Member Functions | |
WorkStealingQueue () | |
Construct a new WorkStealingQueue object. | |
WorkStealingQueue (const WorkStealingQueue &other)=delete | |
void | push (T data) |
Push data into the queue. More... | |
bool | empty () const |
Check if the queue is empty. More... | |
bool | try_pop (T &result) |
Try to pop an element from the front of the queue. More... | |
bool | try_steal (T &result) |
Try to pop an element from the front of the queue. More... | |
size_t | size () const |
returns the size of the queue. (The value may be outdated) More... | |
work-stealing queue.
This work-stealing queue is implemented as a simple wrapper around a deque.
To improve performance from a cache locality perspective the queue act as a LIFO for its own thread and as a FIFO for the stealing one.
T |
|
inline |
Check if the queue is empty.
|
inline |
Push data into the queue.
data | data to push. |
|
inline |
returns the size of the queue. (The value may be outdated)
|
inline |
Try to pop an element from the front of the queue.
result | reference where to insert the popped element. |
|
inline |
Try to pop an element from the front of the queue.
result | reference where to insert the popped element. |