|
ThreadSchedule 3.0.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.
Referenced by threadschedule::advanced::global_thread_pool::init(), and threadschedule::advanced::global_work_stealing_pool::init().
|
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< PoolType >::parallel_for_each(), threadschedule::detail::global_pool_backend< PoolType >::post(), threadschedule::detail::global_pool_backend< PoolType >::submit(), threadschedule::detail::global_pool_backend< PoolType >::submit_batch(), threadschedule::detail::global_pool_backend< PoolType >::try_post(), threadschedule::detail::global_pool_backend< PoolType >::try_submit(), and threadschedule::detail::global_pool_backend< PoolType >::try_submit_batch().
|
inlinestatic |
Definition at line 125 of file global_pool_backend.hpp.
References threadschedule::detail::global_pool_backend< PoolType >::instance().
Referenced by threadschedule::detail::parallel_for_each().
|
inlinestatic |
Definition at line 97 of file global_pool_backend.hpp.
References threadschedule::detail::global_pool_backend< PoolType >::instance().
|
inlinestatic |
Definition at line 83 of file global_pool_backend.hpp.
References threadschedule::detail::global_pool_backend< PoolType >::instance().
|
inlinestatic |
Definition at line 111 of file global_pool_backend.hpp.
References threadschedule::detail::global_pool_backend< PoolType >::instance().
|
inlinestatic |
Definition at line 104 of file global_pool_backend.hpp.
References threadschedule::detail::global_pool_backend< PoolType >::instance().
Referenced by threadschedule::advanced::global_thread_pool::post(), and threadschedule::advanced::global_work_stealing_pool::post().
|
inlinestatic |
Definition at line 90 of file global_pool_backend.hpp.
References threadschedule::detail::global_pool_backend< PoolType >::instance().
Referenced by threadschedule::advanced::global_thread_pool::submit(), and threadschedule::advanced::global_work_stealing_pool::submit().
|
inlinestatic |
Definition at line 118 of file global_pool_backend.hpp.
References threadschedule::detail::global_pool_backend< PoolType >::instance().