Executors#
Executors accept work into a queue and run it by calling operator()() on the provided work item.
The following executors are provided by the core library of TooManyCooks:
general-purpose multi-threaded executor |
|
general-purpose single-threaded executor |
|
serializing executor |
|
type-erased wrapper that can represent any TMC executor |
Other libraries in the TMC ecosystem provide the following executors:
I/O executor built on the Asio library |
Each executor instance manages a completely independent set of resources / threads, and you can create multiple of the same kind of executor if you wish.
Work can be submitted for execution to any executor using the tmc::post() / tmc::post_bulk() functions.
From within a task that is already running on an executor, tmc::spawn() / tmc::spawn_many() can be used to submit work to the same executor.
For more information on how to integrate your own executor with TMC, see Integrating External Executors.