|
ThreadSchedule 2.0.0
Modern C++ thread management library
|
Singleton accessor for a process-wide pool instance. More...
#include <thread_pool.hpp>
Static Public Member Functions | |
| static void | init (size_t num_threads) |
| Pre-configure the number of threads before first use. | |
| static auto | instance () -> PoolType & |
| Access the singleton pool instance (created on first call). | |
Forwarding wrappers | |
All methods below simply forward to | |
| template<typename F, typename... Args> | |
| static auto | submit (F &&f, Args &&... args) |
| template<typename F, typename... Args> | |
| static auto | try_submit (F &&f, Args &&... args) |
| template<typename F, typename... Args> | |
| static void | post (F &&f, Args &&... args) |
| template<typename F, typename... Args> | |
| static auto | try_post (F &&f, Args &&... args) |
| template<typename Iterator> | |
| static auto | submit_batch (Iterator begin, Iterator end) |
| template<typename Iterator> | |
| static auto | try_submit_batch (Iterator begin, Iterator end) |
| template<typename Iterator, typename F> | |
| static void | parallel_for_each (Iterator begin, Iterator end, F &&func) |
Singleton accessor for a process-wide pool instance.
Provides static convenience methods that forward to a single pool whose lifetime is managed as a function-local static (Meyer's singleton).
std::thread::hardware_concurrency() threads. This size is fixed for the lifetime of the process.| PoolType | The concrete pool type to wrap. |
Definition at line 2150 of file thread_pool.hpp.
|
inlinestatic |
Pre-configure the number of threads before first use.
Must be called before instance() is first invoked. Subsequent calls are ignored (std::call_once semantics).
Definition at line 2159 of file thread_pool.hpp.
|
inlinestatic |
Access the singleton pool instance (created on first call).
Definition at line 2165 of file thread_pool.hpp.
|
inlinestatic |
Definition at line 2212 of file thread_pool.hpp.
|
inlinestatic |
Definition at line 2188 of file thread_pool.hpp.
|
inlinestatic |
Definition at line 2176 of file thread_pool.hpp.
|
inlinestatic |
Definition at line 2200 of file thread_pool.hpp.
|
inlinestatic |
Definition at line 2194 of file thread_pool.hpp.
|
inlinestatic |
Definition at line 2182 of file thread_pool.hpp.
|
inlinestatic |
Definition at line 2206 of file thread_pool.hpp.