20 #ifndef __TPIE_JOB_MANAGER_H__
21 #define __TPIE_JOB_MANAGER_H__
28 #include <condition_variable>
35 enum job_state { job_idle, job_enqueued, job_running };
87 size_t m_dependencies;
94 std::condition_variable m_done;
job()
Default constructor.
virtual ~job()
Default destructor.
virtual void on_done()
Called when this job and all subjobs are done.
bool is_done()
Return true if this job and its subjobs are done.
void finish_job()
Used by tpie_finish to deinitialize the job subsystem.
void init_job()
Used by tpie_init to initialize the job subsystem.
void join()
Wait for this job and its subjobs to complete.
memory_size_type default_worker_count()
Return the number of job threads initialized by the job framework in init_job().
virtual void operator()()=0
Called by the worker thread.
friend class job_manager
The job manager needs to invoke run() on us.
void enqueue(job *parent=0)
Add this job to the job pool.