Create a multi‐priority thread pool with the given size and priorities.

Synopsis

Declared in <bdlmt_multiprioritythreadpool.h>

MultipriorityThreadPool(
    int numThreads,
    int numPriorities,
    bslma::Allocator* basicAllocator = 0);

Description

Create a multi‐priority thread pool capable of concurrently executing the specified numThreads "jobs" with associated integer priorities in the specified range [0 .. numPriorities ‐ 1], 0 being the most urgent. Optionally specify threadAttributes used to customize each worker thread created by this thread pool, in which case the attribute pertaining to whether the worker threads are created in the detached state is ignored. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used. The newly created thread pool will initially be enabled for enqueuing jobs, but with no worker threads created. The behavior is undefined unless 1 <= numThreads and 1 <= numPriorities <= k_MAX_NUM_PRIORITIES.

Parameters

Name

Description

numThreads

number of worker threads to create when started

numPriorities

number of distinct job priority levels

basicAllocator

memory allocator; null uses the default

Created with MrDocs