#include <SerialTaskQueue.h>
Classes | |
class | QueuedTask |
class | TaskBase |
Public Member Functions | |
bool | isPaused () const |
Checks to see if the queue has been paused. More... | |
const SerialTaskQueue & | operator= (const SerialTaskQueue &)=delete |
bool | pause () |
Pauses processing of additional tasks from the queue. More... | |
template<typename T > | |
void | push (tbb::task_group &, const T &iAction) |
asynchronously pushes functor iAction into queue More... | |
bool | resume () |
Resumes processing if the queue was paused. More... | |
SerialTaskQueue () | |
SerialTaskQueue (SerialTaskQueue &&iOther) | |
SerialTaskQueue (const SerialTaskQueue &)=delete | |
~SerialTaskQueue () | |
Private Member Functions | |
TaskBase * | finishedTask () |
TaskBase * | pickNextTask () |
TaskBase * | pushAndGetNextTask (TaskBase *) |
void | pushTask (TaskBase *) |
void | spawn (TaskBase &) |
Private Attributes | |
std::atomic< unsigned long > | m_pauseCount |
std::atomic< bool > | m_taskChosen |
tbb::concurrent_queue< TaskBase * > | m_tasks |
Friends | |
class | TaskBase |
Definition at line 67 of file SerialTaskQueue.h.
|
inline |
Definition at line 69 of file SerialTaskQueue.h.
|
inline |
Definition at line 71 of file SerialTaskQueue.h.
References cms::cuda::assert(), m_taskChosen, and m_tasks.
|
delete |
SerialTaskQueue::~SerialTaskQueue | ( | ) |
Definition at line 27 of file SerialTaskQueue.cc.
References g, isPaused(), m_taskChosen, m_tasks, or, push(), and GlobalPosition_Frontier_DevDB_cff::tag.
|
private |
Definition at line 85 of file SerialTaskQueue.cc.
References m_taskChosen, and pickNextTask().
Referenced by spawn().
|
inline |
Checks to see if the queue has been paused.
Definition at line 87 of file SerialTaskQueue.h.
References m_pauseCount.
Referenced by ~SerialTaskQueue().
|
delete |
|
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().
Definition at line 99 of file SerialTaskQueue.h.
References m_pauseCount.
Referenced by edm::LimitedTaskQueue::Resumer::Resumer().
|
private |
Definition at line 90 of file SerialTaskQueue.cc.
References LIKELY, m_pauseCount, m_taskChosen, m_tasks, and submitPVValidationJobs::t.
Referenced by finishedTask(), pushAndGetNextTask(), and resume().
void SerialTaskQueue::push | ( | tbb::task_group & | iGroup, |
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.
[in] | iAction | Must be a functor that takes no arguments and return no values. |
Definition at line 167 of file SerialTaskQueue.h.
References pushTask().
Referenced by edm::EventProcessor::beginLumiAsync(), evf::GlobalEvFOutputEventWriter::doOutputEventAsync(), edm::eventsetup::ESSourceDataProxyBase::prefetchAsyncImpl(), and ~SerialTaskQueue().
|
private |
Definition at line 76 of file SerialTaskQueue.cc.
References LIKELY, m_tasks, and pickNextTask().
Referenced by pushTask().
|
private |
Definition at line 69 of file SerialTaskQueue.cc.
References pushAndGetNextTask(), spawn(), and submitPVValidationJobs::t.
Referenced by push().
bool SerialTaskQueue::resume | ( | ) |
Resumes processing if the queue was paused.
Multiple calls to resume() are allowed if there were multiple calls to pause(). Only when we reach as many resume() calls as pause() calls will the queue restart.
Definition at line 58 of file SerialTaskQueue.cc.
References m_pauseCount, pickNextTask(), spawn(), and submitPVValidationJobs::t.
Referenced by edm::EventProcessor::globalEndLumiAsync(), edm::LimitedTaskQueue::Resumer::operator=(), and edm::Worker::RunModuleTask< T >::EnableQueueGuard::~EnableQueueGuard().
|
private |
Definition at line 41 of file SerialTaskQueue.cc.
References edm::SerialTaskQueue::TaskBase::execute(), finishedTask(), g, edm::SerialTaskQueue::TaskBase::group(), and submitPVValidationJobs::t.
Referenced by pushTask(), and resume().
|
friend |
Definition at line 150 of file SerialTaskQueue.h.
|
private |
Definition at line 163 of file SerialTaskQueue.h.
Referenced by isPaused(), pause(), pickNextTask(), and resume().
|
private |
Definition at line 162 of file SerialTaskQueue.h.
Referenced by finishedTask(), pickNextTask(), SerialTaskQueue(), and ~SerialTaskQueue().
|
private |
Definition at line 161 of file SerialTaskQueue.h.
Referenced by pickNextTask(), pushAndGetNextTask(), SerialTaskQueue(), and ~SerialTaskQueue().