ThreadSchedule 1.0.0
Modern C++ thread management library
Loading...
Searching...
No Matches
threadschedule::FastThreadPoolWithErrors Class Reference

Fast thread pool with built-in error handling. More...

#include <thread_pool_with_errors.hpp>

Public Member Functions

 FastThreadPoolWithErrors (size_t num_threads=std::thread::hardware_concurrency())
template<typename F, typename... Args>
auto submit (F &&f, Args &&... args) -> FutureWithErrorHandler< std::invoke_result_t< F, Args... > >
template<typename F, typename... Args>
auto submit_with_description (std::string const &description, F &&f, Args &&... args) -> FutureWithErrorHandler< std::invoke_result_t< F, Args... > >
auto add_error_callback (ErrorCallback callback) -> size_t
void clear_error_callbacks ()
auto error_count () const -> size_t
void reset_error_count ()
auto pool () -> FastThreadPool &
auto get_statistics () const -> FastThreadPool::Statistics
auto configure_threads (std::string const &name_prefix, SchedulingPolicy policy=SchedulingPolicy::OTHER, ThreadPriority priority=ThreadPriority::normal()) -> bool
auto distribute_across_cpus () -> bool
void shutdown ()
auto size () const noexcept -> size_t
auto pending_tasks () const -> size_t

Detailed Description

Fast thread pool with built-in error handling.

Definition at line 185 of file thread_pool_with_errors.hpp.

Constructor & Destructor Documentation

◆ FastThreadPoolWithErrors()

threadschedule::FastThreadPoolWithErrors::FastThreadPoolWithErrors ( size_t num_threads = std::thread::hardware_concurrency())
inlineexplicit

Definition at line 188 of file thread_pool_with_errors.hpp.

Member Function Documentation

◆ add_error_callback()

auto threadschedule::FastThreadPoolWithErrors::add_error_callback ( ErrorCallback callback) -> size_t
inline

Definition at line 244 of file thread_pool_with_errors.hpp.

◆ clear_error_callbacks()

void threadschedule::FastThreadPoolWithErrors::clear_error_callbacks ( )
inline

Definition at line 249 of file thread_pool_with_errors.hpp.

◆ configure_threads()

auto threadschedule::FastThreadPoolWithErrors::configure_threads ( std::string const & name_prefix,
SchedulingPolicy policy = SchedulingPolicy::OTHER,
ThreadPriority priority = ThreadPriority::normal() ) -> bool
inline

Definition at line 274 of file thread_pool_with_errors.hpp.

◆ distribute_across_cpus()

auto threadschedule::FastThreadPoolWithErrors::distribute_across_cpus ( ) -> bool
inline

Definition at line 280 of file thread_pool_with_errors.hpp.

◆ error_count()

auto threadschedule::FastThreadPoolWithErrors::error_count ( ) const -> size_t
inlinenodiscard

Definition at line 254 of file thread_pool_with_errors.hpp.

◆ get_statistics()

auto threadschedule::FastThreadPoolWithErrors::get_statistics ( ) const -> FastThreadPool::Statistics
inlinenodiscard

Definition at line 269 of file thread_pool_with_errors.hpp.

◆ pending_tasks()

auto threadschedule::FastThreadPoolWithErrors::pending_tasks ( ) const -> size_t
inlinenodiscard

Definition at line 295 of file thread_pool_with_errors.hpp.

◆ pool()

auto threadschedule::FastThreadPoolWithErrors::pool ( ) -> FastThreadPool&
inlinenodiscard

Definition at line 264 of file thread_pool_with_errors.hpp.

◆ reset_error_count()

void threadschedule::FastThreadPoolWithErrors::reset_error_count ( )
inline

Definition at line 259 of file thread_pool_with_errors.hpp.

◆ shutdown()

void threadschedule::FastThreadPoolWithErrors::shutdown ( )
inline

Definition at line 285 of file thread_pool_with_errors.hpp.

◆ size()

auto threadschedule::FastThreadPoolWithErrors::size ( ) const -> size_t
inlinenodiscardnoexcept

Definition at line 290 of file thread_pool_with_errors.hpp.

◆ submit()

template<typename F, typename... Args>
auto threadschedule::FastThreadPoolWithErrors::submit ( F && f,
Args &&... args ) -> FutureWithErrorHandler<std::invoke_result_t<F, Args...>>
inline

Definition at line 194 of file thread_pool_with_errors.hpp.

◆ submit_with_description()

template<typename F, typename... Args>
auto threadschedule::FastThreadPoolWithErrors::submit_with_description ( std::string const & description,
F && f,
Args &&... args ) -> FutureWithErrorHandler<std::invoke_result_t<F, Args...>>
inline

Definition at line 218 of file thread_pool_with_errors.hpp.


The documentation for this class was generated from the following file: