BloombergLP::bdlmt::ThreadPool::ThreadPool

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);
» more...

Construct a thread pool with variable worker count.

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

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);
» more...

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);
» more...

Parameters

NameDescription
threadAttributesattributes used when creating worker threads
minThreadsminimum number of worker threads
maxThreadsmaximum number of worker threads
maxIdleTimeidle time before a thread may exit
basicAllocatormemory allocator; null uses the default
threadPoolNamename identifying this thread pool
metricsRegistrymetrics registry, or singleton if 0