[#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 `&lt;bdlmt&lowbar;threadpool&period;h&gt;`

Construct a thread pool with a `TimeInterval` idle time&period;


[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&period;&period;&period;_]#

Construct a thread pool with variable worker count&period;


[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&period;&period;&period;_]#

Construct a thread pool with `TimeInterval` idle time and a name&period;


[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&lowbar;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&period;&period;&period;_]#

Construct a thread pool with the specified `threadPoolName`&period;


[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&lowbar;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&period;&period;&period;_]#

== 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&semi; 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]#
