#include <SerialTaskQueue.h>
|
bool | isPaused () const |
| Checks to see if the queue has been paused. More...
|
|
bool | pause () |
| Pauses processing of additional tasks from the queue. More...
|
|
template<typename T > |
void | push (const T &iAction) |
| asynchronously pushes functor iAction into queue More...
|
|
template<typename T > |
tbb::task * | pushAndGetNextTaskToRun (const T &iAction) |
| asynchronously pushes functor iAction into queue and finds next task to execute More...
|
|
template<typename T > |
void | pushAndWait (const T &iAction) |
| synchronously pushes functor iAction into queue More...
|
|
bool | resume () |
| Resumes processing if the queue was paused. More...
|
|
| SerialTaskQueue () |
|
Definition at line 65 of file SerialTaskQueue.h.
edm::SerialTaskQueue::SerialTaskQueue |
( |
| ) |
|
|
inline |
tbb::task * SerialTaskQueue::finishedTask |
( |
| ) |
|
|
private |
bool edm::SerialTaskQueue::isPaused |
( |
| ) |
const |
|
inline |
bool edm::SerialTaskQueue::pause |
( |
| ) |
|
|
inline |
Pauses processing of additional tasks from the queue.
Any task already running will not be paused however once that running task finishes no further tasks will be started. Multiple calls to pause() are allowed, however each call to pause() must be balanced by a call to resume().
- Returns
- false if queue was already paused.
- See Also
- resume(), isPaused()
Definition at line 90 of file SerialTaskQueue.h.
template<typename T >
void SerialTaskQueue::push |
( |
const T & |
iAction | ) |
|
asynchronously pushes functor iAction into queue
The function will return immediately and iAction will either process concurrently with the calling thread or wait until the protected resource becomes available or until a CPU becomes available.
- Parameters
-
[in] | iAction | Must be a functor that takes no arguments and return no values. |
Definition at line 184 of file SerialTaskQueue.h.
tbb::task * SerialTaskQueue::pushAndGetNextTask |
( |
TaskBase * |
iTask | ) |
|
|
private |
template<typename T >
tbb::task * SerialTaskQueue::pushAndGetNextTaskToRun |
( |
const T & |
iAction | ) |
|
asynchronously pushes functor iAction into queue and finds next task to execute
This function is useful if you are accessing the SerialTaskQueue for the execute() method of a TBB task and want to efficiently schedule the next task from the queue. In that case you can take the return value and return it directly from your execute() method. The function will return immediately and not wait for iAction to run.
- Parameters
-
[in] | iAction | Must be a functor that takes no arguments and return no values. |
- Returns
- Returns either the next task that the user must schedule with TBB or a nullptr.
Definition at line 200 of file SerialTaskQueue.h.
template<typename T >
void SerialTaskQueue::pushAndWait |
( |
const T & |
iAction | ) |
|
synchronously pushes functor iAction into queue
The function will wait until iAction has completed before returning. If another task is already running on the queue, the system is allowed to find another TBB task to execute while waiting for the iAction to finish. In that way the core is not idled while waiting.
- Parameters
-
[in] | iAction | Must be a functor that takes no arguments and return no values. |
Definition at line 191 of file SerialTaskQueue.h.
void SerialTaskQueue::pushAndWait |
( |
tbb::empty_task * |
iWait, |
|
|
TaskBase * |
iTask |
|
) |
| |
|
private |
void SerialTaskQueue::pushTask |
( |
TaskBase * |
iTask | ) |
|
|
private |
bool SerialTaskQueue::resume |
( |
| ) |
|
std::atomic<unsigned long> edm::SerialTaskQueue::m_pauseCount |
|
private |
std::atomic_flag edm::SerialTaskQueue::m_taskChosen |
|
private |
tbb::concurrent_queue<TaskBase*> edm::SerialTaskQueue::m_tasks |
|
private |