#include <MTqueue.hh>
Collaboration diagram for RazorBack::MTqueue_:
Public Methods | |
MTqueue_ () | |
Init to empty. | |
template<class Fwditer_> void | submit_jobs (Fwditer_ First, Fwditer_ Last) |
submit_jobs(First, Last): pushes a range of job objects between the iterators First and Last onto the priority queue and waits until all jobs have been completed by the working threads. More... | |
void | wait_4job () const |
wait_4job(): this is to be used by the working threads to wait until someone pushes a job onto the queue. | |
MTqueue_::Jobq_ | pop_job () |
pop_job(): takes a job object wrapper from the priority queue, removes it from the queue and returns it. More... | |
Private Attributes | |
priority_queue<Jobq_> | Jobqueue |
jobs queued for the working threads. | |
Mutex_ | Qmutex |
controls access to the queue. | |
Condvar_ | Todo |
to alert working threads to do some job. |
The jobs must be independent of each other.
Definition at line 112 of file MTqueue.hh.
|
Init to empty.
Definition at line 153 of file MTqueue.hh. |
|
submit_jobs(First, Last): pushes a range of job objects between the iterators First and Last onto the priority queue and waits until all jobs have been completed by the working threads. The job objects may be stored in any STL sequence, vectors and lists are good choices. It is assumed that the objects in the sequence between First and Last are of a type derived from MTjobbase_. |
|
wait_4job(): this is to be used by the working threads to wait until someone pushes a job onto the queue.
Definition at line 172 of file MTqueue.hh. |
|
pop_job(): takes a job object wrapper from the priority queue, removes it from the queue and returns it. If the queue was empty then an empty wrapper is returned. |
|
jobs queued for the working threads.
Definition at line 145 of file MTqueue.hh. |
|
controls access to the queue.
Definition at line 146 of file MTqueue.hh. |
|
to alert working threads to do some job.
Definition at line 147 of file MTqueue.hh. |