|
ThreadSchedule 2.0.0
Modern C++ thread management library
|
Classes | |
| 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... | |
Functions | |
| 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 | 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 > |
| 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. | |
|
inline |
Definition at line 721 of file scheduler_policy.hpp.
|
inline |
|
inline |
Definition at line 673 of file scheduler_policy.hpp.
Referenced by threadschedule::BaseThreadWrapper< ThreadType, OwnershipTag >::set_name(), threadschedule::PThreadWrapper::set_name(), and threadschedule::ThreadControlBlock::set_name().
|
inline |
Definition at line 716 of file scheduler_policy.hpp.
References apply_scheduling_policy(), and threadschedule::OTHER.
|
inline |
Definition at line 661 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(), and threadschedule::ThreadControlBlock::set_priority().
|
inline |
Apply policy + optional affinity to any type exposing set_scheduling_policy() and set_affinity().
Definition at line 114 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 133 of file profiles.hpp.
Referenced by threadschedule::apply_profile(), threadschedule::apply_profile(), and threadschedule::apply_profile().
|
inline |
Definition at line 640 of file scheduler_policy.hpp.
References threadschedule::SchedulerParams::create_for_policy().
Referenced by apply_scheduling_policy(), and apply_scheduling_policy().
|
inline |
Definition at line 709 of file scheduler_policy.hpp.
References apply_sched_params().
|
inline |
Definition at line 654 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(), and threadschedule::ThreadControlBlock::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 129 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 37 of file thread_pool.hpp.
Referenced by threadschedule::HighPerformancePool::configure_threads(), threadschedule::LightweightPoolT< TaskSize >::configure_threads(), and threadschedule::ThreadPoolBase< IndefiniteWait >::configure_threads().
|
inline |
|
inline |
Definition at line 88 of file thread_pool.hpp.
Referenced by threadschedule::HighPerformancePool::parallel_for_each(), and threadschedule::ThreadPoolBase< IndefiniteWait >::parallel_for_each().
|
inline |
Definition at line 690 of file scheduler_policy.hpp.
Referenced by threadschedule::BaseThreadWrapper< ThreadType, OwnershipTag >::get_affinity(), and threadschedule::PThreadWrapper::get_affinity().
|
inline |
Definition at line 682 of file scheduler_policy.hpp.
Referenced by threadschedule::BaseThreadWrapper< ThreadType, OwnershipTag >::get_name(), and threadschedule::PThreadWrapper::get_name().
|
inline |
Definition at line 55 of file thread_pool.hpp.
Referenced by threadschedule::HighPerformancePool::set_affinity(), threadschedule::LightweightPoolT< TaskSize >::set_affinity(), and threadschedule::ThreadPoolBase< IndefiniteWait >::set_affinity().