|
void * | threadfun (void *arg) |
| Waits until there is a job in the queue, pops it off and executes it, then waits for another. More...
|
|
void | Job_free (Job *job) |
| Destroy a Job.
|
|
JobQueue * | JobQueue_new (int maxThreads, void *threadData, void *(*ThreadState_new)(void *), void(*ThreadState_free)(void *)) |
| Construct a JobQueue.
|
|
void | JobQueue_addJob (JobQueue *jq, int(*jobfun)(void *, void *), void *param) |
| Add a job to the queue. More...
|
|
void | JobQueue_noMoreJobs (JobQueue *jq) |
| Stop accepting jobs.
|
|
void | JobQueue_waitOnJobs (JobQueue *jq) |
| Wait until all threads are idle.
|
|
void | JobQueue_free (JobQueue *jq) |
| Destroy a JobQueue.
|
|
Multithreaded job queue.
- Author
- Alan R. Rogers
This file implements a multithreaded job queue. Jobs are pushed onto a queue by the main program. Each thread (or worker) removes a job from the queue, executes it, and then goes back for another. When all jobs are finished, control returns to the main function.
- Copyright
- Copyright (c) 2014, Alan R. Rogers roger.nosp@m.s@an.nosp@m.thro..nosp@m.utah.nosp@m..edu. This file is released under the Internet Systems Consortium License, which can be found in file "LICENSE".