Executor that implements a centralized task queue with a speculative execution strategy.
More...
#include <speculative_threadpool.hpp>
template<typename Closure>
class tf::SpeculativeThreadpool< Closure >
Executor that implements a centralized task queue with a speculative execution strategy.
- Template Parameters
-
◆ SpeculativeThreadpool()
template<typename Closure >
constructs the executor with a given number of worker threads
- Parameters
-
N | the number of worker threads |
◆ ~SpeculativeThreadpool()
template<typename Closure >
destructs the executor
Destructing the executor immediately forces all worker threads to stop. The executor does not guarantee all tasks to finish upon destruction.
◆ batch()
template<typename Closure >
moves a batch of closures to the executor
- Parameters
-
closures | a vector of closures to move |
◆ emplace()
template<typename Closure >
template<typename... ArgsT>
constructs the closure in place in the executor
- Template Parameters
-
ArgsT... | argument parameter pack |
- Parameters
-
args... | arguments to forward to the constructor of the closure |
The documentation for this class was generated from the following file: