structure handling a fixed-size pool of threads
More...
#include </home/runner/work/MFrontGenericInterfaceSupport/MFrontGenericInterfaceSupport/include/MGIS/ThreadPool.hxx>
|
| | ThreadPool (const size_type) |
| | constructor
|
| |
| template<typename F , typename... Args> |
| std::future< ThreadedTaskResult< std::invoke_result_t< F, Args... > > > | addTask (F &&, Args &&...) |
| | add a new task
|
| |
| size_type | getNumberOfThreads () const |
| |
|
void | wait () |
| | wait for all tasks to be finished
|
| |
|
| ~ThreadPool () |
| | destructor
|
| |
|
template<typename F , typename... Args> |
| std::future< ThreadedTaskResult< std::invoke_result_t< F, Args... > > > | addTask (F &&f, Args &&... a) |
| |
structure handling a fixed-size pool of threads
◆ ThreadPool()
| mgis::ThreadPool::ThreadPool |
( |
const size_type |
| ) |
|
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... > > > mgis::ThreadPool::addTask |
( |
F && |
, |
|
|
Args && |
... |
|
) |
| |
add a new task
- Parameters
-
| [in] | f | task |
| [in] | a | arguments passed to the the task |
◆ getNumberOfThreads()
| size_type mgis::ThreadPool::getNumberOfThreads |
( |
| ) |
const |
- Returns
- the number of threads managed by the ppol
The documentation for this struct was generated from the following files: