alpaka
Abstraction Library for Parallel Kernel Acceleration
|
A thread pool yielding when there is not enough work to be done. More...
#include <ThreadPool.hpp>
Public Types | |
using | Task = std::packaged_task< void()> |
Public Member Functions | |
ThreadPool (std::size_t threadCount) | |
Creates a thread pool with a given thread count. More... | |
~ThreadPool () | |
Destroys the thread pool, blocking until all enqueued work is done. More... | |
template<typename TFnObj , typename... TArgs> | |
auto | enqueueTask (TFnObj &&task, TArgs &&... args) -> std::future< void > |
Runs the given function on one of the pool in First In First Out (FIFO) order. More... | |
A thread pool yielding when there is not enough work to be done.
Definition at line 19 of file ThreadPool.hpp.
using alpaka::core::detail::ThreadPool::Task = std::packaged_task<void()> |
Definition at line 21 of file ThreadPool.hpp.
|
inlineexplicit |
Creates a thread pool with a given thread count.
Definition at line 24 of file ThreadPool.hpp.
|
inline |
Destroys the thread pool, blocking until all enqueued work is done.
Definition at line 34 of file ThreadPool.hpp.
|
inline |
Runs the given function on one of the pool in First In First Out (FIFO) order.
task | Function object to be called on the pool. Takes an arbitrary number of arguments. Must return void. |
args | Arguments for task, cannot be moved. If such parameters must be used, use a lambda and capture via move then move the lambda. |
Definition at line 56 of file ThreadPool.hpp.