KASKADE 7 development version
|
A concurrent fifo queue. More...
#include <threading.hh>
A concurrent fifo queue.
The queue is not copyable as it is intended to hold non-copyable std:packaged_task objects.
Definition at line 131 of file threading.hh.
Public Member Functions | |
ConcurrentQueue () | |
Constructs an empty queue. More... | |
ConcurrentQueue (ConcurrentQueue &&q) | |
Moves a queue. More... | |
ConcurrentQueue & | operator= (ConcurrentQueue const &q) |
Assignment. More... | |
bool | empty () const |
size_t | size () const |
Returns the number of tasks waiting. More... | |
void | push_back (T &&t) |
Stores an element at the end of the queue. More... | |
T | pop_front () |
Retrieves the foremost element. More... | |
int | running (int n) |
Change the number of running worker threads. More... | |
int | running () const |
Get the number of running worker threads. More... | |
|
inline |
Constructs an empty queue.
Definition at line 136 of file threading.hh.
|
inline |
Moves a queue.
This transferres all tasks waiting in q to the newly constructed queue, but leaves q intact.
Definition at line 146 of file threading.hh.
|
inline |
Definition at line 164 of file threading.hh.
|
inline |
Assignment.
This copies all tasks waiting in q to the newly constructed queue, but leaves q intact.
Definition at line 157 of file threading.hh.
|
inline |
Retrieves the foremost element.
This method blocks if the queue is empty and waits for data to become available.
Definition at line 198 of file threading.hh.
|
inline |
Stores an element at the end of the queue.
Definition at line 184 of file threading.hh.
|
inline |
Get the number of running worker threads.
Definition at line 230 of file threading.hh.
|
inline |
Change the number of running worker threads.
n | if 1, increment the number of running workers, if -1, decrement it. |
Definition at line 219 of file threading.hh.
Referenced by Kaskade::NumaThreadPool::runningOnGlobalQueue().
|
inline |
Returns the number of tasks waiting.
Definition at line 174 of file threading.hh.