Fixed‐size thread pool for running arbitrary tasks concurrently.
Synopsis
Declared in <util/threadpool.h>
class ThreadPool;
Description
Pool of worker threads used to fetch coins in parallel.
Type Aliases
Name |
Description |
Future type holding the result of a callable of type F. |
|
Packaged‐task type wrapping a callable of type F for queuing. |
|
Future type holding the result of invoking an element of range R. |
Enums
Name |
Description |
Reason a task submission was rejected by the pool. |
Member Functions
Name |
Description |
|
Constructs an idle pool with a name used as a prefix for worker thread names. |
|
Stops the pool if still running and joins any remaining workers. |
Stop accepting new tasks and begin asynchronous shutdown. |
|
Execute a single queued task synchronously. Removes one task from the queue and executes it on the calling thread. |
|
Start worker threads. |
|
Stop all worker threads and wait for them to exit. |
|
|
|
Reports the number of tasks currently waiting in the queue. |
|
Reports the number of active worker threads. |
Created with MrDocs