C4 Engine
C4 Engine API Documentation

ThreadMgr::SubmitJob

Defined in:  C4Threads.h
Submits a job for execution.
Prototype

void SubmitJob(Job *job);

void SubmitJob(BatchJob *job, Batch *batch);

Parameters
job The job to submit.
batch The batch to which the job is added.
Description
The SubmitJob function submits the job specified by the job parameter to the Thread Manager for execution. The Thread Manager adds the job to a queue, and it is executed by the next available worker thread. Worker threads take jobs from the queue in first-in-first-out order.

If the batch parameter is specified, then the job parameter must specify a batch job. The job is added to the batch before the SubmitJob function returns.

No assumptions should be made about when a job starts executing. A job may or may not have begun executing before the SubmitJob function returns.

If the job specified by the job parameter is already in the executing state when the SubmitJob function is called, then the SubmitJob function waits for the job to finish execution before queuing for execution again.
See Also

ThreadMgr::CancelJob

ThreadMgr::CancelJobArray

ThreadMgr::FinishBatch