Construct a fixed‐size thread pool.

Synopsis

Declared in <bdlmt_fixedthreadpool.h>

FixedThreadPool(
    int numThreads,
    int maxNumPendingJobs,
    bslma::Allocator* basicAllocator = 0);

Description

Construct a thread pool with the specified numThreads number of threads and a job queue of capacity sufficient to enqueue the specified maxNumPendingJobs without blocking. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used. The name used for created threads is "bdl.FixedPool". The behavior is undefined unless 1 <= numThreads. Note that the actual job queue capacity can be obtained using queueCapacity, and may be more than maxNumPendingJobs.

Parameters

Name

Description

numThreads

number of processing threads

maxNumPendingJobs

capacity of the pending‐job queue

basicAllocator

memory allocator; null uses the default

Created with MrDocs