Create a thread multiplexor with the specified processor and queue limits.
Synopsis
Declared in <bdlmt_threadmultiplexor.h>
ThreadMultiplexor(
int maxProcessors,
int maxQueueSize,
bslma::Allocator* basicAllocator = 0);
Description
Create a thread multiplexor which uses, at most, the specified maxProcessors number of threads to process user‐specified jobs, identified as callbacks of type Job. Jobs that cannot be processed immediately are placed on a queue having the specified maxQueueSize to be processed by the next free thread. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used. The behavior is undefined unless 0 < maxProcessors and 0 < maxQueueSize.
Parameters
Name |
Description |
maxProcessors |
maximum number of threads that may process jobs |
maxQueueSize |
capacity of the pending job queue |
basicAllocator |
allocator used to supply memory |
Created with MrDocs