libUPnP  1.6.17
Data Fields
THREADPOOL Struct Reference

A thread pool similar to the thread pool in the UPnP SDK. More...

#include <ThreadPool.h>

Collaboration diagram for THREADPOOL:
Collaboration graph
[legend]

Data Fields

ithread_mutex_t mutex
ithread_cond_t condition
ithread_cond_t start_and_shutdown
int lastJobId
int shutdown
int totalThreads
int pendingWorkerThreadStart
int busyThreads
int persistentThreads
FreeList jobFreeList
LinkedList lowJobQ
LinkedList medJobQ
LinkedList highJobQ
ThreadPoolJobpersistentJob
ThreadPoolAttr attr
ThreadPoolStats stats

Detailed Description

A thread pool similar to the thread pool in the UPnP SDK.

Allows jobs to be scheduled for running by threads in a thread pool. The thread pool is initialized with a minimum and maximum thread number as well as a max idle time and a jobs per thread ratio. If a worker thread waits the whole max idle time without receiving a job and the thread pool currently has more threads running than the minimum then the worker thread will exit. If when scheduling a job the current job to thread ratio becomes greater than the set ratio and the thread pool currently has less than the maximum threads then a new thread will be created.


Field Documentation

number of threads that are currently executing jobs

Referenced by AddWorker(), ThreadPoolInit(), and WorkerThread().

ithread_cond_t THREADPOOL::condition

ids for jobs

Referenced by ThreadPoolAdd(), ThreadPoolAddPersistent(), and ThreadPoolInit().

ithread_mutex_t THREADPOOL::mutex

flag that's set when waiting for a new worker thread to start

Referenced by CreateWorker(), ThreadPoolInit(), and WorkerThread().

number of persistent threads

Referenced by AddWorker(), ThreadPoolAddPersistent(), ThreadPoolInit(), and WorkerThread().

whether or not we are shutting down

Referenced by ThreadPoolGetAttr(), ThreadPoolInit(), ThreadPoolShutdown(), and WorkerThread().

Condition variable for start and stop.

Referenced by CreateWorker(), ThreadPoolAddPersistent(), ThreadPoolInit(), ThreadPoolShutdown(), and WorkerThread().

statistics

Referenced by CreateWorker(), ThreadPoolInit(), and WorkerThread().


The documentation for this struct was generated from the following file: