|
ThreadSchedule 4.1.0
Modern C++ thread management library
|
Singleton accessor for a process-wide pool instance. More...
#include <global_pool_backend.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 54 of file global_pool_backend.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 64 of file global_pool_backend.hpp.
|
inlinestatic |
Access the singleton pool instance (created on first call).
Definition at line 71 of file global_pool_backend.hpp.
Referenced by threadschedule::detail::global_pool_backend< thread_pool_backend >::parallel_for_each(), threadschedule::detail::global_pool_backend< thread_pool_backend >::post(), threadschedule::detail::global_pool_backend< thread_pool_backend >::submit(), threadschedule::detail::global_pool_backend< thread_pool_backend >::submit_batch(), threadschedule::detail::global_pool_backend< thread_pool_backend >::try_post(), threadschedule::detail::global_pool_backend< thread_pool_backend >::try_submit(), and threadschedule::detail::global_pool_backend< thread_pool_backend >::try_submit_batch().
|
inlinestatic |
Definition at line 125 of file global_pool_backend.hpp.
|
inlinestatic |
Definition at line 97 of file global_pool_backend.hpp.
|
inlinestatic |
Definition at line 83 of file global_pool_backend.hpp.
|
inlinestatic |
Definition at line 111 of file global_pool_backend.hpp.
|
inlinestatic |
Definition at line 104 of file global_pool_backend.hpp.
|
inlinestatic |
Definition at line 90 of file global_pool_backend.hpp.
|
inlinestatic |
Definition at line 118 of file global_pool_backend.hpp.