|
ThreadSchedule 2.2.0
Modern C++ thread management library
|
Classes | |
| class | function_ref |
| class | function_ref< R(Args...)> |
| struct | NonOwningTag |
| Tag type selecting non-owning (pointer) storage in ThreadStorage. More... | |
| struct | OwningTag |
| Tag type selecting owning (value) storage in ThreadStorage. More... | |
| class | QueryFacadeMixin |
| CRTP mixin that provides functional-style query facade methods. More... | |
| class | SboCallable |
| Type-erased, move-only callable with configurable inline storage. More... | |
| class | ThreadStorage |
| class | ThreadStorage< ThreadType, NonOwningTag > |
| Non-owning thread storage - holds a raw pointer to an external thread. More... | |
| class | ThreadStorage< ThreadType, OwningTag > |
| Owning thread storage - holds the thread object by value. More... | |
Typedefs | |
| template<typename T> | |
| using | remove_cvref_t = std::remove_cv_t<std::remove_reference_t<T>> |
| template<typename Signature> | |
| using | move_callable = std::function<Signature> |
| template<typename Signature> | |
| using | copyable_callable = std::function<Signature> |
Functions | |
| template<typename Signature, typename Callable> | |
| auto | make_move_callable (Callable &&callable) -> move_callable< Signature > |
| template<typename Signature, typename Callable> | |
| auto | make_copyable_callable (Callable &&callable) -> copyable_callable< Signature > |
| template<typename T> | |
| auto | apply_profile_to (T &t, ThreadProfile const &p) -> expected< void, std::error_code > |
| Apply policy + optional affinity to any type exposing set_scheduling_policy() and set_affinity(). | |
| template<typename PoolType> | |
| auto | apply_profile_to_pool (PoolType &pool, std::string const &name_prefix, ThreadProfile const &p) -> expected< void, std::error_code > |
| Apply configure_threads + optional affinity to any pool type. | |
| template<typename SetSchedFn> | |
| auto | apply_sched_params (SchedulingPolicy policy, ThreadPriority priority, SetSchedFn &&set_sched) -> expected< void, std::error_code > |
| auto | apply_scheduling_policy (pthread_t handle, SchedulingPolicy policy, ThreadPriority priority) -> expected< void, std::error_code > |
| auto | apply_priority (pthread_t handle, ThreadPriority priority) -> expected< void, std::error_code > |
| auto | apply_affinity (pthread_t handle, ThreadAffinity const &affinity) -> expected< void, std::error_code > |
| auto | apply_name (pthread_t handle, std::string const &name) -> expected< void, std::error_code > |
| auto | read_name (pthread_t handle) -> std::optional< std::string > |
| auto | read_affinity (pthread_t handle) -> std::optional< ThreadAffinity > |
| auto | read_priority (pthread_t handle) -> std::optional< int > |
| auto | read_scheduling_policy (pthread_t handle) -> std::optional< SchedulingPolicy > |
| auto | apply_scheduling_policy (pid_t tid, SchedulingPolicy policy, ThreadPriority priority) -> expected< void, std::error_code > |
| auto | apply_priority (pid_t tid, ThreadPriority priority) -> expected< void, std::error_code > |
| auto | apply_affinity (pid_t tid, ThreadAffinity const &affinity) -> expected< void, std::error_code > |
| auto | apply_name (pid_t tid, std::string const &name) -> expected< void, std::error_code > |
| auto | read_name (pid_t tid) -> std::optional< std::string > |
| auto | read_affinity (pid_t tid) -> std::optional< ThreadAffinity > |
| auto | read_priority (pid_t tid) -> std::optional< int > |
| auto | read_scheduling_policy (pid_t tid) -> std::optional< SchedulingPolicy > |
| template<typename WorkerRange> | |
| auto | configure_worker_threads (WorkerRange &workers, std::string const &name_prefix, SchedulingPolicy policy, ThreadPriority priority) -> expected< void, std::error_code > |
| template<typename WorkerRange> | |
| auto | set_worker_affinity (WorkerRange &workers, ThreadAffinity const &affinity) -> expected< void, std::error_code > |
| template<typename WorkerRange> | |
| auto | distribute_workers_across_cpus (WorkerRange &workers) -> expected< void, std::error_code > |
| template<typename Pool, typename Iterator, typename F> | |
| void | parallel_for_each_chunked (Pool &pool, Iterator begin, Iterator end, F &&func, size_t num_workers) |
| template<typename F, typename... Args> | |
| auto | bind_args (F &&f, Args &&... args) |
| Bind a callable with its arguments into a nullary lambda. | |
| template<typename ThreadLike> | |
| auto | configure_thread (ThreadLike &thread, std::string const &name, SchedulingPolicy policy, ThreadPriority priority) -> expected< void, std::error_code > |
| using threadschedule::detail::copyable_callable = std::function<Signature> |
Definition at line 40 of file callable.hpp.
| using threadschedule::detail::move_callable = std::function<Signature> |
Definition at line 32 of file callable.hpp.
| using threadschedule::detail::remove_cvref_t = std::remove_cv_t<std::remove_reference_t<T>> |
Definition at line 25 of file callable.hpp.
|
inline |
Definition at line 853 of file scheduler_policy.hpp.
|
inline |
Definition at line 780 of file scheduler_policy.hpp.
Referenced by threadschedule::BaseThreadWrapper< ThreadType, OwnershipTag >::set_affinity(), threadschedule::PThreadWrapper::set_affinity(), threadschedule::ThreadByNameView::set_affinity(), threadschedule::ThreadControlBlock::set_affinity(), and threadschedule::ThreadInfo::set_affinity().
|
inline |
Definition at line 860 of file scheduler_policy.hpp.
|
inline |
Definition at line 787 of file scheduler_policy.hpp.
Referenced by threadschedule::BaseThreadWrapper< ThreadType, OwnershipTag >::set_name(), threadschedule::PThreadWrapper::set_name(), threadschedule::ThreadByNameView::set_name(), threadschedule::ThreadControlBlock::set_name(), and threadschedule::ThreadInfo::set_name().
|
inline |
Definition at line 848 of file scheduler_policy.hpp.
References apply_scheduling_policy(), and threadschedule::OTHER.
|
inline |
Definition at line 775 of file scheduler_policy.hpp.
References apply_scheduling_policy(), and threadschedule::OTHER.
Referenced by threadschedule::BaseThreadWrapper< ThreadType, OwnershipTag >::set_priority(), threadschedule::PThreadWrapper::set_priority(), threadschedule::ThreadByNameView::set_priority(), threadschedule::ThreadControlBlock::set_priority(), and threadschedule::ThreadInfo::set_priority().
|
inline |
Apply policy + optional affinity to any type exposing set_scheduling_policy() and set_affinity().
Definition at line 115 of file profiles.hpp.
Referenced by threadschedule::apply_profile(), and threadschedule::apply_profile().
|
inline |
Apply configure_threads + optional affinity to any pool type.
Definition at line 134 of file profiles.hpp.
Referenced by threadschedule::apply_profile(), threadschedule::apply_profile(), and threadschedule::apply_profile().
|
inline |
Definition at line 754 of file scheduler_policy.hpp.
References threadschedule::SchedulerParams::create_for_policy().
Referenced by apply_scheduling_policy(), and apply_scheduling_policy().
|
inline |
Definition at line 841 of file scheduler_policy.hpp.
References apply_sched_params().
|
inline |
Definition at line 768 of file scheduler_policy.hpp.
References apply_sched_params().
Referenced by apply_priority(), apply_priority(), threadschedule::BaseThreadWrapper< ThreadType, OwnershipTag >::set_scheduling_policy(), threadschedule::PThreadWrapper::set_scheduling_policy(), threadschedule::ThreadByNameView::set_scheduling_policy(), threadschedule::ThreadControlBlock::set_scheduling_policy(), and threadschedule::ThreadInfo::set_scheduling_policy().
| auto threadschedule::detail::bind_args | ( | F && | f, |
| Args &&... | args ) |
Bind a callable with its arguments into a nullary lambda.
On C++20 and later this uses pack init-captures for zero intermediate storage overhead. On C++17 it falls back to std::make_tuple / std::apply which is still significantly faster than std::bind.
Definition at line 131 of file thread_pool.hpp.
Referenced by threadschedule::HighPerformancePool::try_post(), threadschedule::LightweightPoolT< TaskSize >::try_post(), threadschedule::ThreadPoolBase< IndefiniteWait >::try_post(), threadschedule::HighPerformancePool::try_submit(), and threadschedule::ThreadPoolBase< IndefiniteWait >::try_submit().
|
inline |
Definition at line 116 of file thread_wrapper.hpp.
Referenced by threadschedule::ScheduledThreadPoolT< ThreadPool >::configure_scheduler_thread(), and threadschedule::ChaosController::configure_thread().
|
inline |
Definition at line 39 of file thread_pool.hpp.
Referenced by threadschedule::HighPerformancePool::configure_threads(), threadschedule::LightweightPoolT< TaskSize >::configure_threads(), and threadschedule::ThreadPoolBase< IndefiniteWait >::configure_threads().
|
inline |
| auto threadschedule::detail::make_copyable_callable | ( | Callable && | callable | ) | -> copyable_callable<Signature> |
Definition at line 117 of file callable.hpp.
Referenced by threadschedule::ErrorHandler::add_callback(), threadschedule::ScheduledThreadPoolT< ThreadPool >::schedule_periodic_after(), threadschedule::ScheduledThreadPoolT< ThreadPool >::schedule_periodic_after(), threadschedule::ThreadRegistry::set_on_register(), threadschedule::HighPerformancePool::set_on_task_end(), threadschedule::ThreadPoolBase< IndefiniteWait >::set_on_task_end(), threadschedule::HighPerformancePool::set_on_task_start(), threadschedule::ThreadPoolBase< IndefiniteWait >::set_on_task_start(), and threadschedule::ThreadRegistry::set_on_unregister().
| auto threadschedule::detail::make_move_callable | ( | Callable && | callable | ) | -> move_callable<Signature> |
Definition at line 111 of file callable.hpp.
Referenced by threadschedule::PThreadWrapper::create_with_attributes(), threadschedule::FutureWithErrorHandler< T >::on_error(), threadschedule::PThreadWrapper::PThreadWrapper(), threadschedule::ScheduledThreadPoolT< ThreadPool >::schedule_after(), threadschedule::ScheduledThreadPoolT< ThreadPool >::schedule_after(), threadschedule::ScheduledThreadPoolT< ThreadPool >::schedule_at(), threadschedule::ScheduledThreadPoolT< ThreadPool >::schedule_at(), and threadschedule::HighPerformancePool::try_post().
|
inline |
Definition at line 90 of file thread_pool.hpp.
Referenced by threadschedule::HighPerformancePool::parallel_for_each(), and threadschedule::ThreadPoolBase< IndefiniteWait >::parallel_for_each().
|
inline |
Definition at line 891 of file scheduler_policy.hpp.
|
inline |
Definition at line 804 of file scheduler_policy.hpp.
Referenced by threadschedule::BaseThreadWrapper< ThreadType, OwnershipTag >::get_affinity(), threadschedule::PThreadWrapper::get_affinity(), and threadschedule::ThreadInfo::get_affinity().
|
inline |
Definition at line 877 of file scheduler_policy.hpp.
|
inline |
Definition at line 796 of file scheduler_policy.hpp.
Referenced by threadschedule::BaseThreadWrapper< ThreadType, OwnershipTag >::get_name(), threadschedule::PThreadWrapper::get_name(), threadschedule::ThreadByNameView::get_name(), and threadschedule::ThreadInfo::get_name().
|
inline |
Definition at line 907 of file scheduler_policy.hpp.
|
inline |
Definition at line 821 of file scheduler_policy.hpp.
Referenced by threadschedule::ThreadInfo::get_priority().
|
inline |
Definition at line 915 of file scheduler_policy.hpp.
|
inline |
Definition at line 830 of file scheduler_policy.hpp.
Referenced by threadschedule::ThreadInfo::get_policy().
|
inline |
Definition at line 57 of file thread_pool.hpp.
Referenced by threadschedule::HighPerformancePool::set_affinity(), threadschedule::LightweightPoolT< TaskSize >::set_affinity(), and threadschedule::ThreadPoolBase< IndefiniteWait >::set_affinity().