[#BloombergLP-bdlmt-ThreadPool-2constructor-0e] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlmt.adoc[bdlmt]::xref:BloombergLP/bdlmt/ThreadPool.adoc[ThreadPool]::ThreadPool :relfileprefix: ../../../ :mrdocs: Constructors == Synopses Declared in `<bdlmt_threadpool.h>` Construct a thread pool with a `TimeInterval` idle time. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdlmt/ThreadPool/2constructor-0b.adoc[ThreadPool]( xref:BloombergLP/bslmt/ThreadAttributes.adoc[bslmt::ThreadAttributes] const& threadAttributes, int minThreads, int maxThreads, xref:BloombergLP/bsls/TimeInterval.adoc[bsls::TimeInterval] maxIdleTime, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0); ---- [.small]#xref:BloombergLP/bdlmt/ThreadPool/2constructor-0b.adoc[_» more..._]# Construct a thread pool with variable worker count. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdlmt/ThreadPool/2constructor-01.adoc[ThreadPool]( xref:BloombergLP/bslmt/ThreadAttributes.adoc[bslmt::ThreadAttributes] const& threadAttributes, int minThreads, int maxThreads, int maxIdleTime, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0); ---- [.small]#xref:BloombergLP/bdlmt/ThreadPool/2constructor-01.adoc[_» more..._]# Construct a thread pool with `TimeInterval` idle time and a name. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdlmt/ThreadPool/2constructor-0a2.adoc[ThreadPool]( xref:BloombergLP/bslmt/ThreadAttributes.adoc[bslmt::ThreadAttributes] const& threadAttributes, int minThreads, int maxThreads, xref:BloombergLP/bsls/TimeInterval.adoc[bsls::TimeInterval] maxIdleTime, std::string_view const& threadPoolName, xref:BloombergLP/bdlm/MetricsRegistry.adoc[bdlm::MetricsRegistry]* metricsRegistry, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0); ---- [.small]#xref:BloombergLP/bdlmt/ThreadPool/2constructor-0a2.adoc[_» more..._]# Construct a thread pool with the specified `threadPoolName`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdlmt/ThreadPool/2constructor-0a3.adoc[ThreadPool]( xref:BloombergLP/bslmt/ThreadAttributes.adoc[bslmt::ThreadAttributes] const& threadAttributes, int minThreads, int maxThreads, int maxIdleTime, std::string_view const& threadPoolName, xref:BloombergLP/bdlm/MetricsRegistry.adoc[bdlm::MetricsRegistry]* metricsRegistry, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0); ---- [.small]#xref:BloombergLP/bdlmt/ThreadPool/2constructor-0a3.adoc[_» more..._]# == Parameters [cols="1,4"] |=== | 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 |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#