|
threadman 0.1.0
Header-only C++23 managed threads, dynamic pools, futures, and executors
|
Elastic executor for blocking future-waits. More...
#include <future_wait_pool.hpp>


Public Member Functions | |
| FutureWaitPool (FutureWaitPoolOptions opts={}, ThreadManager *manager=nullptr) | |
| FutureWaitPool (const FutureWaitPool &)=delete | |
| FutureWaitPool & | operator= (const FutureWaitPool &)=delete |
| FutureWaitPool (FutureWaitPool &&) noexcept=default | |
| FutureWaitPool & | operator= (FutureWaitPool &&) noexcept=default |
| ~FutureWaitPool () override=default | |
| void | execute (std::function< void()> task) override |
| std::string_view | name () const noexcept override |
| template<class T > | |
| Future< T > | add (std::future< T > fut) |
Adopt a std::future<T>. | |
| template<class T > | |
| Future< T > | add (std::shared_future< T > fut) |
Adopt a std::shared_future<T>. | |
| template<class Fn > requires std::invocable<Fn> | |
| auto | add_blocking (Fn &&fn) -> Future< std::invoke_result_t< Fn > > |
Run an arbitrary blocking callable on the wait pool, returning a Future<R>. | |
| std::uint64_t | id () const noexcept |
| std::size_t | worker_count () const noexcept |
| std::size_t | core_worker_count () const noexcept |
| std::size_t | max_worker_count () const noexcept |
| ThreadPoolStats | stats () const |
| std::vector< ThreadSnapshot > | snapshot_workers () const |
| ThreadPool & | pool () const noexcept |
| void | shutdown () const |
| void | shutdown_now () const |
| void | join () const |
| bool | is_shutting_down () const noexcept |
| bool | is_terminated () const noexcept |
Public Member Functions inherited from threadman::IExecutor | |
| virtual | ~IExecutor ()=default |
Static Public Member Functions | |
| static const comms::DisplayInfo & | display_info () |
Elastic executor for blocking future-waits.
Owns its backing ThreadPool. Move-only (the inner pool lives on the heap, so the registered pool pointer stays valid across moves). Also satisfies IExecutor, so it can be passed anywhere an executor is expected.
|
inlineexplicit |
|
delete |
|
defaultnoexcept |
|
overridedefault |
|
inline |
Adopt a std::future<T>.
The blocking get() runs on a pool worker; the returned Future<T> is satisfied with its value or its exception. Move-only T is supported (the value is moved out of the std::future).
|
inline |
Adopt a std::shared_future<T>.
Same semantics as the std::future overload; the value is copied out (shared futures require copyable T).
|
inline |
Run an arbitrary blocking callable on the wait pool, returning a Future<R>.
Convenience for "this work blocks; give it elastic
capacity" without first wrapping it in a std::future.
|
inlinenoexcept |
|
inlinestatic |
|
inlineoverridevirtual |
Implements threadman::IExecutor.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
|
inlinenoexcept |
|
inlineoverridevirtualnoexcept |
Implements threadman::IExecutor.
|
delete |
|
defaultnoexcept |
|
inlinenoexcept |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinenoexcept |