|
ThreadSchedule 2.2.0
Modern C++ thread management library
|
A pool that executes every task inline on the calling thread. More...
#include <inline_pool.hpp>
Public Member Functions | |
| InlinePool (size_t=0) | |
| template<typename F, typename... Args> | |
| auto | submit (F &&f, Args &&... args) -> std::future< std::invoke_result_t< F, Args... > > |
| template<typename F, typename... Args> | |
| auto | try_submit (F &&f, Args &&... args) -> expected< std::future< std::invoke_result_t< F, Args... > >, std::error_code > |
| template<typename F, typename... Args> | |
| void | post (F &&f, Args &&... args) |
| template<typename F, typename... Args> | |
| auto | try_post (F &&f, Args &&... args) -> expected< void, std::error_code > |
| template<typename Iterator> | |
| auto | try_submit_batch (Iterator begin, Iterator end) -> expected< std::vector< std::future< void > >, std::error_code > |
| template<typename Iterator> | |
| auto | submit_batch (Iterator begin, Iterator end) -> std::vector< std::future< void > > |
| template<typename Iterator, typename F> | |
| void | parallel_for_each (Iterator begin, Iterator end, F &&func) |
| auto | size () const noexcept -> size_t |
| auto | pending_tasks () const noexcept -> size_t |
| void | wait_for_tasks () |
| void | shutdown (ShutdownPolicy=ShutdownPolicy::drain) |
A pool that executes every task inline on the calling thread.
Useful for deterministic unit testing: tasks run synchronously in submission order with no concurrency, making results fully reproducible and debuggable.
Definition at line 42 of file inline_pool.hpp.
|
inlineexplicit |
Definition at line 45 of file inline_pool.hpp.
|
inline |
Definition at line 143 of file inline_pool.hpp.
|
inlinenodiscardnoexcept |
Definition at line 150 of file inline_pool.hpp.
|
inline |
Definition at line 87 of file inline_pool.hpp.
References try_post().
|
inline |
Definition at line 153 of file inline_pool.hpp.
References threadschedule::drain.
|
inlinenodiscardnoexcept |
Definition at line 149 of file inline_pool.hpp.
|
inline |
Definition at line 50 of file inline_pool.hpp.
References try_submit().
|
inline |
Definition at line 134 of file inline_pool.hpp.
References try_submit_batch().
|
inline |
Definition at line 95 of file inline_pool.hpp.
Referenced by post().
|
inline |
Definition at line 59 of file inline_pool.hpp.
Referenced by submit().
|
inline |
Definition at line 110 of file inline_pool.hpp.
Referenced by submit_batch().
|
inline |
Definition at line 152 of file inline_pool.hpp.