Constructors

Synopses

Declared in <bdlmt_threadpool.h>

Construct a thread pool with a TimeInterval idle time.

ThreadPool(
    bslmt::ThreadAttributes const& threadAttributes,
    int minThreads,
    int maxThreads,
    bsls::TimeInterval maxIdleTime,
    bslma::Allocator* basicAllocator = 0);

Construct a thread pool with variable worker count.

ThreadPool(
    bslmt::ThreadAttributes const& threadAttributes,
    int minThreads,
    int maxThreads,
    int maxIdleTime,
    bslma::Allocator* basicAllocator = 0);

Construct a thread pool with TimeInterval idle time and a name.

ThreadPool(
    bslmt::ThreadAttributes const& threadAttributes,
    int minThreads,
    int maxThreads,
    bsls::TimeInterval maxIdleTime,
    std::string_view const& threadPoolName,
    bdlm::MetricsRegistry* metricsRegistry,
    bslma::Allocator* basicAllocator = 0);

Construct a thread pool with the specified threadPoolName.

ThreadPool(
    bslmt::ThreadAttributes const& threadAttributes,
    int minThreads,
    int maxThreads,
    int maxIdleTime,
    std::string_view const& threadPoolName,
    bdlm::MetricsRegistry* metricsRegistry,
    bslma::Allocator* basicAllocator = 0);

Parameters

Name

Description

threadAttributes

attributes used when creating worker threads

minThreads

minimum number of worker threads

maxThreads

maximum number of worker threads

maxIdleTime

idle time before a thread may exit

basicAllocator

memory allocator; null uses the default

threadPoolName

name identifying this thread pool

metricsRegistry

metrics registry, or singleton if 0

Created with MrDocs