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

This class implements a thread pool used for concurrently executing multiple user&hyphen;defined functions (&quot;jobs&quot;)&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class FixedThreadPool;
----

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlmt/FixedThreadPool/Job.adoc[`Job`] 
| Defines a type alias for the job functor type&period;
| xref:BloombergLP/bdlmt/FixedThreadPool/Queue.adoc[`Queue`] 
| Defines a type alias for the bounded job queue type&period;
|===


== Enums

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlmt/FixedThreadPool/_04enum-0c.adoc[`Unnamed enum`] 
| Status codes returned by queue operations&period;
| xref:BloombergLP/bdlmt/FixedThreadPool/_04enum-08.adoc[`Unnamed enum`] 
| Thread&hyphen;pool operational states&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlmt/FixedThreadPool/2constructor-03.adoc[`FixedThreadPool`]         [.small]#[constructor]#
| Constructors
| xref:BloombergLP/bdlmt/FixedThreadPool/2destructor.adoc[`&#126;FixedThreadPool`] [.small]#[destructor]#
| Remove all pending jobs from the queue without executing them, block until all currently running jobs complete, and then destroy this thread pool&period;
| xref:BloombergLP/bdlmt/FixedThreadPool/disable.adoc[`disable`] 
| Disable enqueueing into this pool&period;
| xref:BloombergLP/bdlmt/FixedThreadPool/drain.adoc[`drain`] 
| Drain queued and executing jobs without disabling this pool&period;
| xref:BloombergLP/bdlmt/FixedThreadPool/enable.adoc[`enable`] 
| Enable queuing into this pool&period; If the queue is not enqueue disabled, this call has no effect&period;
| xref:BloombergLP/bdlmt/FixedThreadPool/enqueueJob-04.adoc[`enqueueJob`] 
| `enqueueJob` overloads
| xref:BloombergLP/bdlmt/FixedThreadPool/isEnabled.adoc[`isEnabled`] 
| Return `true` if enqueuing jobs is enabled on this thread pool, and `false` otherwise&period;
| xref:BloombergLP/bdlmt/FixedThreadPool/isStarted.adoc[`isStarted`] 
| Return `true` if `numThreads()` are started on this threadpool and `false` otherwise (indicating that 0 threads are started on this thread pool&period;)
| xref:BloombergLP/bdlmt/FixedThreadPool/numActiveThreads.adoc[`numActiveThreads`] 
| Return a snapshot of the number of threads that are currently processing a job for this threadpool&period;
| xref:BloombergLP/bdlmt/FixedThreadPool/numPendingJobs.adoc[`numPendingJobs`] 
| Return a snapshot of the number of jobs currently enqueued to be processed by thread pool&period;
| xref:BloombergLP/bdlmt/FixedThreadPool/numThreads.adoc[`numThreads`] 
| Return the number of threads passed to this thread pool at construction&period;
| xref:BloombergLP/bdlmt/FixedThreadPool/numThreadsStarted.adoc[`numThreadsStarted`] 
| Return a snapshot of the number of threads currently started by this thread pool&period;
| xref:BloombergLP/bdlmt/FixedThreadPool/queueCapacity.adoc[`queueCapacity`] 
| Return the capacity of the queue used to enqueue jobs by this thread pool&period;
| xref:BloombergLP/bdlmt/FixedThreadPool/shutdown.adoc[`shutdown`] 
| Shut down this thread pool&period;
| xref:BloombergLP/bdlmt/FixedThreadPool/start.adoc[`start`] 
| Spawn processing threads and enable enqueuing&period;
| xref:BloombergLP/bdlmt/FixedThreadPool/stop.adoc[`stop`] 
| Disable enqueuing, wait for jobs to complete, and join worker threads&period;
| xref:BloombergLP/bdlmt/FixedThreadPool/tryEnqueueJob-0d.adoc[`tryEnqueueJob`] 
| `tryEnqueueJob` overloads
|===



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