1 Introduction
This library contains functions that can be used to create and use pools of persistent worker threads. It
is wrapper around various functions in the pthread library.
Note, functions in this library cannot be used from Fortran.
This library currently includes:
-
(1)
- Wrappers for the basic pthreads functions, that add inherited status handling. These
include:
- thrMutexInit: Initialise a mutex
- thrCondInit: Initialise a condition variable
- thrThreadCreate: Create a thread
- thrMutexLock: Lock a mutex
- thrMutexUnlock: Unlock a mutex
- thrCondBroadcast: Broadcast a condition
- thrCondSignal: Signal a condition
- thrCondWait: Wait for a condition
-
(2)
- A set of functions that maintains a pool of threads ready for use. Each thread in the pool
is described as a “worker” and the whole pool is described as a “workforce”. The
idea is that a task is split into separate jobs, and all jobs are performed in parallel
by the workers in the workforce. Once a workforce has been told about all the jobs
within a task (using thrAddJob), the calling thread waits until all the jobs have been
completed.