NPS Pthread Pool
|
State for a Thread Pool. More...
Data Fields | |
thr_pool_handle_t | handle |
pool handle | |
thr_pool_t * | next |
list to other pools | |
pthread_mutex_t | lock |
protects all (the following) pool data | |
pthread_cond_t | jobcv |
for idle workers to wait on for jobs | |
pthread_cond_t | emptycv |
for caller to wait, while pool non-empty | |
pthread_cond_t | wakecv |
for caller to wait, for ack from worker | |
pthread_t * | tid |
array of all threads in the pool | |
int * | active |
array, if active[j] then tid[j] is active | |
job_t * | job_head |
head of job queue | |
job_t * | job_tail |
tail of job queue | |
int | notice |
notifications for the pool | |
pthread_attr_t | attr |
POSIX thread attributes for workers. | |
unsigned int | timeout |
seconds before idle workers exit | |
unsigned int | min |
minimum number of worker threads | |
unsigned int | max |
maximum number of worker threads | |
unsigned int | nthreads |
current number of worker threads | |
unsigned int | nidle |
number of idle workers |
State for a Thread Pool.
int* thr_pool::active |
array, if active[j] then tid[j] is active
pthread_attr_t thr_pool::attr |
POSIX thread attributes for workers.
pthread_cond_t thr_pool::emptycv |
for caller to wait, while pool non-empty
pool handle
head of job queue
tail of job queue
pthread_cond_t thr_pool::jobcv |
for idle workers to wait on for jobs
pthread_mutex_t thr_pool::lock |
protects all (the following) pool data
unsigned int thr_pool::max |
maximum number of worker threads
unsigned int thr_pool::min |
minimum number of worker threads
list to other pools
unsigned int thr_pool::nidle |
number of idle workers
int thr_pool::notice |
notifications for the pool
unsigned int thr_pool::nthreads |
current number of worker threads
pthread_t* thr_pool::tid |
array of all threads in the pool
unsigned int thr_pool::timeout |
seconds before idle workers exit
pthread_cond_t thr_pool::wakecv |
for caller to wait, for ack from worker