structure handling a fixed-size pool of threads
More...
#include </home/runner/work/tfel/tfel/include/TFEL/System/ThreadPool.hxx>
|
|
using | size_type = std::vector<std::thread>::size_type |
| | a simple alias
|
structure handling a fixed-size pool of threads
◆ ThreadPool()
| tfel::system::ThreadPool::ThreadPool |
( |
const size_type | | ) |
|
|
explicit |
constructor
- Parameters
-
| [in] | n | number of thread to be created |
◆ addTask()
template<typename F, typename... Args>
| std::future< ThreadedTaskResult< std::invoke_result_t< F, Args... > > > tfel::system::ThreadPool::addTask |
( |
F && | , |
|
|
Args && | ... ) |
|
nodiscard |
add a new task
- Parameters
-
| [in] | f | task |
| [in] | a | arguments passed to the the task |
◆ getNumberOfThreads()
| size_type tfel::system::ThreadPool::getNumberOfThreads |
( |
| ) |
const |
|
nodiscard |
- Returns
- the number of threads managed by the ppol
The documentation for this struct was generated from the following files: