3#include "../detail/callable/bind.hpp"
4#include "../detail/pool/backend.hpp"
5#include "../result.hpp"
6#include "../worker_count.hpp"
23 template <
typename F,
typename... Args>
29 template <
typename F,
typename... Args>
33 auto submitted =
submit(std::forward<F>(function), std::forward<Args>(args)...);
35 throw std::system_error(submitted.error(),
"global_work_stealing_pool::submit");
36 return std::move(*submitted);
38 template <
typename F,
typename... Args>
44 template <
typename F,
typename... Args>
48 auto posted =
post(std::forward<F>(function), std::forward<Args>(args)...);
50 throw std::system_error(posted.error(),
"global_work_stealing_pool::post");
static auto post(F &&function, Args &&... args) -> result< void >
static auto submit(F &&function, Args &&... args) -> result< std::future< detail::bind_result_t< F, Args... > > >
static auto submit_or_throw(F &&function, Args &&... args) -> std::future< detail::bind_result_t< F, Args... > >
static void init(worker_count count)
static void post_or_throw(F &&function, Args &&... args)
static auto try_submit(F &&f, Args &&... args)
static auto try_post(F &&f, Args &&... args)
static void init(size_t num_threads)
Pre-configure the number of threads before first use.
Value type for pool worker count.
auto resolve() const noexcept -> std::size_t
Resolve the effective worker count.
std::invoke_result_t< decltype(bind_args(std::declval< F >(), std::declval< Args >()...))& > bind_result_t
Result of invoking the decayed callable and arguments stored by bind_args.
global_pool_backend< work_stealing_pool_backend > global_work_stealing_pool_backend
Singleton accessor for the process-wide work_stealing_pool_backend instance.