Executor that implements a centralized task queue with a simple execution strategy.
More...
#include <simple_threadpool.hpp>
|
| SimpleThreadpool (unsigned N) |
| constructs the executor with a given number of worker threads More...
|
|
| ~SimpleThreadpool () |
| destructs the executor More...
|
|
template<typename... ArgsT> |
void | emplace (ArgsT &&... args) |
| constructs the closure in place in the executor More...
|
|
void | batch (std::vector< Closure > &&closures) |
| moves a batch of closures to the executor More...
|
|
size_t | num_workers () const |
| queries the number of worker threads
|
|
bool | is_owner () const |
| queries if the caller is the owner of the executor
|
|
size_t | num_tasks () const |
|
template<typename Closure>
class tf::SimpleThreadpool< Closure >
Executor that implements a centralized task queue with a simple execution strategy.
- Template Parameters
-
◆ SimpleThreadpool()
template<typename Closure >
constructs the executor with a given number of worker threads
- Parameters
-
N | the number of worker threads |
◆ ~SimpleThreadpool()
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: