General Utility Library for C++14
2.11
|
A thread pool and task queue.
Classes | |
class | gul14::ThreadPool |
A pool of worker threads with a task queue. More... | |
Enumerations | |
enum class | gul14::TaskState { gul14::pending , gul14::running , gul14::complete , gul14::canceled } |
An enum describing the state of an individual task. More... | |
Functions | |
std::shared_ptr< ThreadPool > | gul14::make_thread_pool (std::size_t num_threads, std::size_t capacity=ThreadPool::default_capacity) |
Create a thread pool with the desired number of threads and the specified capacity for queuing tasks. More... | |
|
strong |
|
inline |
Create a thread pool with the desired number of threads and the specified capacity for queuing tasks.
The thread pool is allocated in a shared pointer, which is necessary so that task handles can access the pool safely. A ThreadPool cannot be constructed directly.
References gul14::ThreadPool::capacity(), and gul14::ThreadPool::make_shared().