|A thread pool which can expand and contract (i.e. change the number of pooled threads) based on the work load. The pool has minimum and maximum sizes and a dispatch timeout. If dispatching a work item to a worker thread takes longer than the timeout then the pool is enlarged by one thread. There is also a maximum number of "dormant" threads, that is threads that are not working and when this number is reached worker threads are removed from the pool. The thread pool uses two I/O completion ports to do its work. Work items are dispatched to the dispatch port and are processed by the maintenance thread which dispatches the work items to the work port where the worker threads are waiting. This two layer dispatching means that dispatching from user code is fast but the pool can adjust its size depending on how long it takes for a worker thread to pick up a work item. Work items only ever queue on the dispatch port, the work port will only ever have a single work item on it at a time. More...
|A worker thread for the CThreadPool. The user work is done by an instance of IThreadPoolWorkerThread which is created by the supplied factory in the worker thread's constructor and destroyed in the destructor. More...