[#BloombergLP-bslmt-ThroughputBenchmark-addThreadGroup-0e]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslmt.adoc[bslmt]::xref:BloombergLP/bslmt/ThroughputBenchmark.adoc[ThroughputBenchmark]::addThreadGroup
:relfileprefix: ../../../
:mrdocs:

Create a set of threads that repeatedly execute a test function with per&hyphen;thread initialize and cleanup hooks&period;

== Synopsis

Declared in `&lt;bslmt&lowbar;throughputbenchmark&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
addThreadGroup(
    xref:BloombergLP/bslmt/ThroughputBenchmark/RunFunction.adoc[RunFunction] const& runFunction,
    int numThreads,
    xref:BloombergLP/bsls/Types/Int64.adoc[bsls::Types::Int64] busyWorkAmount,
    xref:BloombergLP/bslmt/ThroughputBenchmark/InitializeThreadFunction.adoc[InitializeThreadFunction] const& initializeFunctor,
    xref:BloombergLP/bslmt/ThroughputBenchmark/CleanupThreadFunction.adoc[CleanupThreadFunction] const& cleanupFunctor);
----

== Description

Create a set of threads, with cardinality the specified `numThreads`, that will repeatedly execute the specified `runFunction` followed by the specified `busyWork`, with the specified `busyWorkAmount` as its argument&period; Return the index for the thread group&period; Specify `initializeFunctor`, which is run at the beginning of each thread of the sample&period; Specify `cleanupFunctor`, which is run at the end of each thread of the sample&period; The behavior is undefined unless `0 &lt; numThreads` and `0 &lt;&equals; busyWorkAmount`&period;


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