This is an example of a thread pool, where a fixed number of threads operate on fixed size queue of jobs. Jobs are represented as function pointers with user specified input. When jobs are added to the queue work threads pick them up and execute until completion. The job queue is protected by a mutex and worker thread availability is managed with a semaphore.
- Install tup.
- Run
$ tup
The API is described in threadpool.h.
Run
test/test
to test and benchmark the library.