Thread pool that executes jobs according to integral priorities.
Synopsis
Declared in <bdlmt_multiprioritythreadpool.h>
class MultipriorityThreadPool;
Description
This class implements a thread‐enabled, integrally‐prioritized thread‐pool mechanism used for concurrently executing multiple user‐defined "jobs" supplied as either conventional C‐style functions taking an optional void * data argument, or as more flexible functor objects.
Type Aliases
Name |
Description |
Type alias for a nullary function object that returns |
Enums
Name |
Description |
Maximum number of distinct job priorities supported by this pool. |
Member Functions
Name |
Description |
|
Constructors |
|
Remove (cancel) all pending jobs and destroy this multi‐priority thread pool. The behavior is undefined unless this thread pool is stopped. |
Disable enqueuing of jobs to this thread pool. |
|
Block until all executing and pending jobs complete. |
|
Enable enqueuing of jobs to this thread pool. |
|
|
|
Return |
|
Return |
|
Return |
|
Return a snapshot of the number of threads currently processing jobs. |
|
Return a snapshot of the number of jobs currently enqueued to be processed by this multi‐priority thread pool, but are not yet running. |
|
Return the fixed number of priorities, specified at construction, that this multi‐priority thread pool supports. |
|
Return the number of threads that have been started for this multi‐priority thread pool. Note that they may be currently suspended. |
|
Returns the fixed number of threads, specified at construction, that are started by this multi‐priority thread pool. |
|
Remove all pending jobs from the queue of this thread pool. |
|
Resume job processing if this thread pool is suspended. |
|
Disable the enqueuing of new jobs to this multi‐priority thread pool, cancel all pending jobs, and stop all worker threads. |
|
Create and start the worker threads of this thread pool. |
|
Destroy all worker threads after active jobs complete. |
|
Put this thread pool into the suspended state. |
|
|
Declare that this type uses a |
Created with MrDocs