[#BloombergLP-bdlmt-FixedThreadPool-2constructor-07]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlmt.adoc[bdlmt]::xref:BloombergLP/bdlmt/FixedThreadPool.adoc[FixedThreadPool]::FixedThreadPool
:relfileprefix: ../../../
:mrdocs:

Construct a thread pool with `threadAttributes` and `threadPoolName`&period;

== Synopsis

Declared in `&lt;bdlmt&lowbar;fixedthreadpool&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
FixedThreadPool(
    xref:BloombergLP/bslmt/ThreadAttributes.adoc[bslmt::ThreadAttributes] const& threadAttributes,
    int numThreads,
    int maxNumPendingJobs,
    std::string&lowbar;view const& threadPoolName,
    xref:BloombergLP/bdlm/MetricsRegistry.adoc[bdlm::MetricsRegistry]* metricsRegistry,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0);
----

== Description

Construct a thread pool with the specified `threadAttributes`, `numThreads` number of threads, a job queue with capacity sufficient to enqueue the specified `maxNumPendingJobs` without blocking, the specified `threadPoolName` to be used to identify this thread pool, and the specified `metricsRegistry` to be used for reporting metrics&period; If `metricsRegistry` is 0, `bdlm&colon;&colon;MetricsRegistry&colon;&colon;singleton()` is used&period; Optionally specify a `basicAllocator` used to supply memory&period; If `basicAllocator` is 0, the currently installed default allocator is used&period; The name used for created threads is `threadAttributes&period;threadName()` if not empty, otherwise `threadPoolName` if not empty, otherwise &quot;bdl&period;FixedPool&quot;&period; The detached state of `threadAttributes` is ignored, and `e&lowbar;CREATE&lowbar;JOINABLE` is used in all cases&period; The behavior is undefined unless `1 &lt;&equals; numThreads`&period; Note that the actual job queue capacity can be obtained using `queueCapacity`, and may be more than `maxNumPendingJobs`&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *threadAttributes*
| attributes used when creating worker threads
| *numThreads*
| number of processing threads
| *maxNumPendingJobs*
| capacity of the pending&hyphen;job queue
| *threadPoolName*
| name identifying this thread pool
| *metricsRegistry*
| metrics registry, or singleton if 0
| *basicAllocator*
| memory allocator&semi; null uses the default
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
