#include <LimitedTaskQueue.h>
Classes | |
class | Resumer |
Public Member Functions | |
unsigned int | concurrencyLimit () const |
LimitedTaskQueue (unsigned int iLimit) | |
template<typename T > | |
void | push (T &&iAction) |
asynchronously pushes functor iAction into queue More... | |
template<typename T > | |
void | pushAndPause (T &&iAction) |
asynchronously pushes functor iAction into queue then pause the queue and run iAction More... | |
template<typename T > | |
void | pushAndWait (T &&iAction) |
synchronously pushes functor iAction into queue More... | |
Private Member Functions | |
LimitedTaskQueue (const LimitedTaskQueue &)=delete | |
const LimitedTaskQueue & | operator= (const LimitedTaskQueue &)=delete |
Private Attributes | |
std::vector< SerialTaskQueue > | m_queues |
Definition at line 38 of file LimitedTaskQueue.h.
|
inline |
Definition at line 40 of file LimitedTaskQueue.h.
References push(), and pushAndWait().
|
privatedelete |
|
inline |
Definition at line 115 of file LimitedTaskQueue.h.
References edm::LimitedTaskQueue::Resumer::LimitedTaskQueue, m_queues, and edm::LimitedTaskQueue::Resumer::operator=().
|
privatedelete |
void LimitedTaskQueue::push | ( | 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 126 of file LimitedTaskQueue.h.
References m_queues, and lumiQueryAPI::q.
Referenced by LimitedTaskQueue(), and edm::Worker::TaskQueueAdaptor::push().
void LimitedTaskQueue::pushAndPause | ( | T && | iAction | ) |
asynchronously pushes functor iAction into queue then pause the queue and run iAction
iAction must take as argument a copy of a LimitedTaskQueue::Resumer. To resume the queue let the last copy of the Resumer go out of scope, or call Resumer::resume(). Using this function will decrease the allowed concurrency limit by 1.
Definition at line 160 of file LimitedTaskQueue.h.
References m_queues, lumiQueryAPI::q, and edm::LimitedTaskQueue::Resumer::Resumer().
void LimitedTaskQueue::pushAndWait | ( | 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.
[in] | iAction | Must be a functor that takes no arguments and return no values. |
Definition at line 139 of file LimitedTaskQueue.h.
References pyrootRender::destroy(), m_queues, and lumiQueryAPI::q.
Referenced by LimitedTaskQueue(), and edm::Worker::TaskQueueAdaptor::pushAndWait().
|
private |
Definition at line 122 of file LimitedTaskQueue.h.
Referenced by concurrencyLimit(), push(), pushAndPause(), and pushAndWait().