#include <thread_pool.hpp>
◆ thread_pool() [1/2]
| ginger::thread_pool::thread_pool |
( |
size_t |
num_threads = std::thread::hardware_concurrency() | ) |
|
|
inlineexplicit |
Construct a thread pool with the given number of worker threads.
- Parameters
-
| [in] | num_threads | Number of worker threads. Defaults to hardware concurrency (min 1). |
◆ ~thread_pool()
| ginger::thread_pool::~thread_pool |
( |
| ) |
|
|
inline |
◆ thread_pool() [2/2]
| ginger::thread_pool::thread_pool |
( |
const thread_pool & |
| ) |
|
|
delete |
◆ enqueue()
template<typename F >
| auto ginger::thread_pool::enqueue |
( |
F && |
task | ) |
-> std::future<std::invoke_result_t<std::decay_t<F>>> |
|
inline |
Enqueue a callable for execution on the thread pool.
- Template Parameters
-
| F | Callable type (invocable, returns T) |
- Parameters
-
- Returns
- std::future<T> holding the result (or exception)
◆ operator=()
The documentation for this class was generated from the following file: