|
ThreadSchedule 4.1.0
Modern C++ thread management library
|
Aggregates multiple thread_registry_backend instances into a single queryable view. More...
Namespaces | |
| namespace | native_schedule |
| namespace | thread_lifecycle |
| namespace | portable_thread_control |
Classes | |
| struct | native_thread_access |
| struct | task_group_has_current_worker_query |
| struct | task_group_has_current_worker_query< Pool, std::void_t< decltype(std::declval< Pool const & >().is_current_worker())> > |
| class | function_ref< R(Args...)> |
| class | move_only_function |
| class | move_only_function< R(Args...), InlineSize > |
| struct | has_stolen_tasks |
| struct | has_stolen_tasks< T, std::void_t< decltype(std::declval< T const & >().stolen_tasks)> > |
| class | submitting_pool_facade |
| class | lightweight_pool_facade |
| class | global_pool_backend |
| Singleton accessor for a process-wide pool instance. More... | |
| struct | indefinite_wait |
| class | inline_pool_backend |
| A pool that executes every task inline on the calling thread. More... | |
| class | lightweight_pool_backend_base |
| Ultra-lightweight fire-and-forget thread pool. More... | |
| struct | polling_wait |
| class | thread_pool_backend_base |
| Single-queue thread pool parameterized by its idle-wait strategy. More... | |
| class | work_stealing_deque |
| class | work_stealing_pool_backend |
| High-performance thread pool optimized for high-frequency task submission. More... | |
| class | worker_startup_latch |
| class | worker_context_guard |
| class | composite_thread_registry_backend |
| class | query_facade_mixin |
| CRTP mixin that provides functional-style query facade methods. More... | |
| class | registered_thread_backend |
| thread_backend with automatic registration in the global thread_registry_backend. More... | |
| class | registration_guard_backend |
| Internal movable RAII guard for worker registration. More... | |
| struct | registered_thread_info_backend |
| Snapshot of metadata for a single registered thread. More... | |
| class | thread_control_block |
| Per-thread control handle for OS-level scheduling operations. More... | |
| class | thread_registry_backend |
| Central registry of threads indexed by OS-level thread ID (native_thread_id). More... | |
| struct | external_registry_binding_state |
| class | scheduled_pool_facade |
| struct | scheduled_cancellation_state |
| class | scheduled_pool_backend_base |
| Thread pool augmented with delayed and periodic task scheduling. More... | |
| class | scheduled_task_backend |
| Copyable handle for a cancellable scheduled task. More... | |
| class | native_thread_priority |
| Value-semantic wrapper for a thread scheduling priority. More... | |
| struct | native_scheduling_config |
| struct | resolved_scheduling |
| class | native_thread_affinity |
| Manages a set of CPU indices to which a thread may be bound. More... | |
| struct | native_thread_config |
| class | scheduler_parameters |
| Static utility class for constructing OS-native scheduling parameters. More... | |
| class | scope_exit |
| class | thread_start_gate |
| struct | native_thread_identity |
| class | thread_identity_state |
| struct | owning_tag |
| Tag type selecting owning (value) storage in thread_storage. More... | |
| struct | non_owning_tag |
| Tag type selecting non-owning (pointer) storage in thread_storage. More... | |
| class | thread_storage |
| class | thread_storage< ThreadType, owning_tag > |
| Owning thread storage - holds the thread object by value. More... | |
| class | thread_storage< ThreadType, non_owning_tag > |
| Non-owning thread storage - holds a raw pointer to an external thread. More... | |
| class | basic_thread_backend |
| Polymorphic base providing common thread management operations. More... | |
| class | thread_backend |
| Owning wrapper around std::thread with RAII join-on-destroy semantics. More... | |
| class | thread_view_backend |
| Non-owning view over an externally managed std::thread. More... | |
| class | thread_info |
| Lightweight handle for querying and controlling a specific OS thread. More... | |
| class | expected_void |
| struct | scheduled_task_access |
| struct | scheduling_config_access |
| struct | thread_id_access |
Enumerations | |
| enum class | shutdown_policy_backend : std::uint8_t { drain , drop_pending } |
| enum class | native_scheduling_policy : std::uint_fast8_t { other = SCHED_OTHER , fifo = SCHED_FIFO , rr = SCHED_RR , batch = SCHED_BATCH , idle = SCHED_IDLE } |
| Enumeration of available thread scheduling policies. More... | |
| enum class | native_scheduling_intent : std::uint_fast8_t { background , normal , interactive , low_latency , realtime } |
| enum class | native_priority_model : std::uint_fast8_t { intent , posix_nice , posix_realtime , windows_thread , platform_native } |
Functions | |
| template<typename Pool> | |
| auto | task_group_is_current_worker (Pool const &pool) noexcept -> bool |
| template<typename F, typename... Args> | |
| auto | bind_args (F &&function, Args &&... args) |
| template<typename Signature, typename Callable> | |
| auto | make_copyable_function (Callable &&callable) -> copyable_function< Signature > |
| template<typename Signature, std::size_t InlineSize = 3 * sizeof(void*), typename Callable> | |
| auto | make_move_only_function (Callable &&callable) -> move_only_function< Signature, InlineSize > |
| auto | shutdown_deadline_after (std::chrono::milliseconds timeout) -> std::chrono::steady_clock::time_point |
| template<typename Backend> | |
| auto | make_pool_backend (worker_count count, worker_registration registration) -> std::unique_ptr< Backend > |
| template<typename Backend> | |
| void | dispose_pool_backend (std::unique_ptr< Backend > &backend) noexcept |
| template<typename Container, typename F> | |
| void | parallel_for_each (Container &container, F &&func) |
Convenience wrapper that applies a callable to every element of a container in parallel using the global_thread_pool_backend singleton. | |
| constexpr auto | to_native (shutdown_policy policy) noexcept -> shutdown_policy_backend |
| template<typename Iterator> | |
| auto | multipass_range_size (Iterator begin, Iterator end) -> size_t |
| void | throw_worker_deadlock () |
| auto | worker_thread_name (std::string const &name_prefix, size_t index) -> std::string |
| template<typename WorkerRange> | |
| auto | configure_worker_threads (WorkerRange &workers, std::string const &name_prefix, native_scheduling_policy policy, native_thread_priority priority, thread_registry_backend *registry=nullptr) -> expected< void, std::error_code > |
| template<typename WorkerRange> | |
| auto | configure_worker_threads (WorkerRange &workers, native_thread_config const &config, thread_registry_backend *registry=nullptr) -> expected< void, std::error_code > |
| template<typename WorkerRange> | |
| auto | set_worker_affinity (WorkerRange &workers, native_thread_affinity 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) |
| auto | default_worker_count () noexcept -> std::size_t |
| auto | checked_worker_count (std::size_t count) -> std::size_t |
| constexpr auto | is_realtime_policy (native_scheduling_policy policy) noexcept -> bool |
| constexpr auto | uses_nice_value (native_scheduling_policy policy) noexcept -> bool |
| constexpr auto | resolve_scheduling_config (native_scheduling_config const &config) noexcept -> resolved_scheduling |
| auto | to_string (native_scheduling_policy policy) -> std::string |
| String conversion utilities. | |
| auto | pthread_call_result (int result) -> expected< void, std::error_code > |
| template<typename SetSchedFn> | |
| auto | apply_sched_params (native_scheduling_policy policy, native_thread_priority priority, SetSchedFn &&set_sched) -> expected< void, std::error_code > |
| auto | apply_scheduling_policy (pthread_t handle, native_scheduling_policy policy, native_thread_priority priority) -> expected< void, std::error_code > |
| auto | apply_affinity (pthread_t handle, native_thread_affinity 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) -> expected< std::string, std::error_code > |
| auto | read_affinity (pthread_t handle) -> expected< native_thread_affinity, std::error_code > |
| auto | read_priority (pthread_t handle) -> std::optional< int > |
| auto | read_scheduling_policy (pthread_t handle) -> std::optional< native_scheduling_policy > |
| auto | apply_scheduling_policy (pid_t tid, native_scheduling_policy policy, native_thread_priority priority) -> expected< void, std::error_code > |
| auto | apply_nice_value (pid_t tid, int nice_value) -> expected< void, std::error_code > |
| auto | apply_affinity (pid_t tid, native_thread_affinity 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) -> expected< std::string, std::error_code > |
| auto | read_affinity (pid_t tid) -> expected< native_thread_affinity, std::error_code > |
| auto | read_priority (pid_t tid) -> std::optional< int > |
| auto | read_nice_value (pid_t tid) -> expected< int, std::error_code > |
| auto | read_scheduling_policy (pid_t tid) -> std::optional< native_scheduling_policy > |
| template<typename NativeHandle> | |
| auto | apply_affinity_checked (NativeHandle handle, native_thread_affinity const &affinity) -> expected< void, std::error_code > |
| template<typename NativeHandle> | |
| auto | apply_scheduling_config (NativeHandle handle, native_thread_id tid, native_scheduling_config const &config) -> expected< void, std::error_code > |
| template<typename NativeHandle> | |
| auto | read_effective_nice (NativeHandle handle, native_thread_id tid) -> expected< int, std::error_code > |
| template<typename F> | |
| auto | make_scope_exit (F &&function) -> scope_exit< std::decay_t< F > > |
| constexpr auto | to_priority_level (int nice_value) noexcept -> priority_level |
| constexpr auto | to_native (scheduling_config config) noexcept -> native_scheduling_config |
| auto | to_native (thread_affinity const &affinity) -> native_thread_affinity |
| auto | to_native (thread_config const &config) -> native_thread_config |
| auto | has_thread_configuration (thread_config const &config) noexcept -> bool |
| auto | from_native (native_thread_affinity const &affinity) -> thread_affinity |
| auto | read_thread_start_time (native_thread_id id) noexcept -> std::optional< std::uint64_t > |
| auto | native_thread_is_alive (native_thread_identity const &identity) noexcept -> bool |
| auto | find_native_threads_by_name (std::string_view name) -> result< std::vector< native_thread_identity > > |
| auto | current_native_thread_id () noexcept -> native_thread_id |
| template<typename ThreadLike> | |
| auto | configure_thread (ThreadLike &thread, std::string const &name, native_scheduling_policy policy, native_thread_priority priority) -> expected< void, std::error_code > |
| template<typename ThreadLike> | |
| auto | configure_thread (ThreadLike &thread, native_thread_config const &config) -> expected< void, std::error_code > |
| template<typename ToDuration, typename Rep, typename Period> | |
| auto | checked_duration_cast (std::chrono::duration< Rep, Period > value) -> expected< ToDuration, std::error_code > |
| template<typename Clock, typename Duration> | |
| auto | checked_deadline_after (std::chrono::time_point< Clock, Duration > now, Duration delay) -> expected< std::chrono::time_point< Clock, Duration >, std::error_code > |
| auto | current_exception_error_code () noexcept -> std::error_code |
| template<typename Function> | |
| auto | try_result (Function &&function) -> decltype(std::forward< Function >(function)()) |
Global registry access | |
These internal free functions provide access to a process-wide thread_registry_backend singleton and allow installing a custom instance.
| |
| auto | runtime_registry () -> thread_registry_backend & |
| void | runtime_set_external_registry (thread_registry_backend *reg) |
| auto | runtime_exchange_external_registry (thread_registry_backend *reg) -> thread_registry_backend * |
| void | runtime_set_external_registry_state (std::shared_ptr< external_registry_binding_state > state) |
| auto | runtime_exchange_external_registry_state (std::shared_ptr< external_registry_binding_state > state) -> std::shared_ptr< external_registry_binding_state > |
| auto | runtime_external_registry_state () -> std::shared_ptr< external_registry_binding_state > |
Variables | |
| template<typename Signature> | |
| class THREADSCHEDULE_POINTER | function_ref |
| template<typename Iterator> | |
| constexpr bool | is_forward_iterator_v = std::is_base_of_v<std::forward_iterator_tag, typename std::iterator_traits<Iterator>::iterator_category> |
| template<typename> | |
| constexpr bool | is_unexpected_v = false |
| template<typename E> | |
| constexpr bool | is_unexpected_v< unexpected< E > > = true |
| template<typename E> | |
| constexpr bool | valid_expected_error_v |
Aggregates multiple thread_registry_backend instances into a single queryable view.
composite_thread_registry_backend is useful when threads are spread across several independent thread_registry_backend instances (e.g. one per shared library) and you want a unified query interface over all of them.
std::mutex.std::mutex).detail::query_facade_mixin implementation. | using threadschedule::detail::bind_result_t = std::invoke_result_t<decltype(bind_args(std::declval<F>(), std::declval<Args>()...))&> |
Result of invoking the decayed callable and arguments stored by bind_args.
Deriving the type from the binder itself keeps overload resolution aligned with the actual one-shot invocation, including std::reference_wrapper unwrapping performed by std::make_tuple.
| using threadschedule::detail::copyable_function = std::function<Signature> |
Definition at line 10 of file copyable_function.hpp.
| using threadschedule::detail::expected_remove_cvref_t = std::remove_cv_t<std::remove_reference_t<T>> |
Definition at line 121 of file expected.hpp.
Singleton accessor for the process-wide thread_pool_backend instance.
Definition at line 155 of file global_pool_backend.hpp.
| using threadschedule::detail::global_work_stealing_pool_backend = global_pool_backend<work_stealing_pool_backend> |
Singleton accessor for the process-wide work_stealing_pool_backend instance.
Definition at line 162 of file global_pool_backend.hpp.
Default lightweight pool with 64-byte task slots (56 bytes usable).
Sufficient for lambdas capturing up to ~7 pointers on 64-bit platforms.
Definition at line 488 of file lightweight_pool_backend_base.hpp.
| using threadschedule::detail::native_thread_id = pid_t |
Definition at line 44 of file native.hpp.
Thread pool with 10 ms polling wait for lower wake-up latency.
Workers poll with condition_variable::wait_for(10 ms), trading a small amount of idle CPU for more consistent latency under bursty workloads.
Definition at line 715 of file thread_pool_backend_base.hpp.
| using threadschedule::detail::registry_callback = detail::copyable_function<void(registered_thread_info_backend const&)> |
Definition at line 79 of file thread_control_block.hpp.
| using threadschedule::detail::remove_cvref_t = std::remove_cv_t<std::remove_reference_t<T>> |
Definition at line 14 of file move_only_function.hpp.
| using threadschedule::detail::scheduled_lightweight_pool_backend = scheduled_pool_backend_base<lightweight_pool_backend> |
scheduled_pool_backend_base using lightweight_pool_backend as backend (minimal overhead).
Definition at line 707 of file scheduled_pool_backend_base.hpp.
| using threadschedule::detail::scheduled_polling_pool_backend = scheduled_pool_backend_base<polling_pool_backend> |
scheduled_pool_backend_base using polling_pool_backend as backend.
Definition at line 704 of file scheduled_pool_backend_base.hpp.
| using threadschedule::detail::scheduled_pool_backend = scheduled_pool_backend_base<thread_pool_backend> |
scheduled_pool_backend_base using the default thread_pool_backend backend.
Definition at line 697 of file scheduled_pool_backend_base.hpp.
| using threadschedule::detail::scheduled_work_stealing_pool_backend = scheduled_pool_backend_base<work_stealing_pool_backend> |
scheduled_pool_backend_base using work_stealing_pool_backend as backend.
Definition at line 701 of file scheduled_pool_backend_base.hpp.
Definition at line 12 of file callbacks.hpp.
Definition at line 16 of file callbacks.hpp.
| using threadschedule::detail::task_start_callback = copyable_function<void(std::chrono::steady_clock::time_point, std::thread::id)> |
Definition at line 11 of file callbacks.hpp.
Definition at line 15 of file callbacks.hpp.
General-purpose thread pool with indefinite blocking wait.
Workers block on condition_variable::wait() when idle - zero CPU consumption, instant wake-up on task submission. Suitable for most workloads.
Definition at line 704 of file thread_pool_backend_base.hpp.
|
strong |
| Enumerator | |
|---|---|
| intent | |
| posix_nice | |
| posix_realtime | |
| windows_thread | |
| platform_native | |
Definition at line 242 of file native.hpp.
|
strong |
| Enumerator | |
|---|---|
| background | |
| normal | |
| interactive | |
| low_latency | |
| realtime | |
Definition at line 233 of file native.hpp.
|
strong |
Enumeration of available thread scheduling policies.
Represents the OS-level scheduling policy applied to a thread. On Linux, the enumerator values map directly to the POSIX SCHED_* constants defined in <sched.h>. On Windows, they are stored as portable integer values and translated to Windows-specific priority classes / scheduling behaviour at the point of application.
| Policy | Description | Privileges required |
|---|---|---|
| OTHER | Default CFS (Completely Fair Scheduler) time-sharing. | None |
| FIFO | Real-time FIFO - runs until it yields or a higher-priority |
thread arrives. | CAP_SYS_NICE or root | | RR | Real-time round-robin - like FIFO but with a per-thread time quantum. | CAP_SYS_NICE or root | | BATCH | Like OTHER but the scheduler assumes the thread is CPU-bound (longer slices).| None | | IDLE | Extremely low priority; runs only when no other runnable thread exists. | None | | DEADLINE | EDF (Earliest Deadline First) real-time scheduling (Linux >= 3.14). Readback only; configuring it requires sched_setattr(). |
Windows does not expose POSIX scheduling policies. The library maps each enumerator to an appropriate combination of process priority class and thread priority level when applying the policy. FIFO and RR are both treated as elevated real-time priorities; BATCH and IDLE are mapped to below-normal and idle priority levels respectively.
| Enumerator | |
|---|---|
| other | Standard round-robin time-sharing. |
| fifo | First in, first out. |
| rr | Round-robin. |
| batch | For batch style execution. |
| idle | For very low priority background tasks. |
Definition at line 84 of file native.hpp.
|
strong |
| Enumerator | |
|---|---|
| drain | |
| drop_pending | |
Definition at line 12 of file shutdown_policy_backend.hpp.
|
inline |
Definition at line 138 of file native.hpp.
|
inline |
Definition at line 51 of file native.hpp.
Referenced by apply_affinity_checked().
|
inline |
Definition at line 790 of file native.hpp.
References apply_affinity(), read_affinity(), and threadschedule::unexpected().
Referenced by threadschedule::advanced::thread_by_name_view::configure(), threadschedule::advanced::thread_by_name_view::set_affinity(), threadschedule::detail::basic_thread_backend< ThreadType, OwnershipTag >::set_affinity(), threadschedule::detail::thread_control_block::set_affinity(), and threadschedule::detail::thread_info::set_affinity().
|
inline |
Definition at line 146 of file native.hpp.
|
inline |
Definition at line 58 of file native.hpp.
Referenced by threadschedule::advanced::thread_by_name_view::set_name(), threadschedule::detail::basic_thread_backend< ThreadType, OwnershipTag >::set_name(), threadschedule::detail::thread_control_block::set_name(), and threadschedule::detail::thread_info::set_name().
|
inline |
Definition at line 126 of file native.hpp.
Referenced by apply_scheduling_config(), threadschedule::detail::basic_thread_backend< ThreadType, OwnershipTag >::set_nice_value(), and threadschedule::detail::thread_control_block::set_nice_value().
|
inline |
Definition at line 24 of file native.hpp.
|
inline |
Definition at line 814 of file native.hpp.
References apply_nice_value(), apply_scheduling_policy(), apply_windows_thread_priority(), threadschedule::detail::native_thread_priority::normal(), other, posix_nice, resolve_scheduling_config(), threadschedule::unexpected(), and windows_thread.
Referenced by threadschedule::advanced::thread_by_name_view::configure(), threadschedule::detail::basic_thread_backend< ThreadType, OwnershipTag >::configure(), threadschedule::detail::thread_control_block::configure(), threadschedule::detail::thread_info::configure(), threadschedule::advanced::thread_by_name_view::set_nice(), threadschedule::advanced::thread_by_name_view::set_priority(), threadschedule::detail::basic_thread_backend< ThreadType, OwnershipTag >::set_priority(), threadschedule::detail::thread_control_block::set_priority(), and threadschedule::detail::thread_info::set_priority().
|
inline |
Definition at line 119 of file native.hpp.
|
inline |
Definition at line 39 of file native.hpp.
Referenced by apply_scheduling_config(), threadschedule::detail::basic_thread_backend< ThreadType, OwnershipTag >::set_scheduling_policy(), threadschedule::detail::thread_control_block::set_scheduling_policy(), and threadschedule::detail::thread_info::set_scheduling_policy().
| auto threadschedule::detail::bind_args | ( | F && | function, |
| Args &&... | args ) |
Definition at line 17 of file bind.hpp.
Referenced by threadschedule::thread_pool::post(), threadschedule::thread_pool::submit(), threadschedule::thread::thread_view, threadschedule::detail::inline_pool_backend::try_post(), threadschedule::detail::lightweight_pool_backend_base< TaskSize >::try_post(), threadschedule::detail::thread_pool_backend_base< indefinite_wait >::try_post(), threadschedule::detail::work_stealing_pool_backend::try_post(), threadschedule::detail::inline_pool_backend::try_submit(), threadschedule::detail::thread_pool_backend_base< indefinite_wait >::try_submit(), and threadschedule::detail::work_stealing_pool_backend::try_submit().
|
inlinenodiscard |
Definition at line 50 of file time.hpp.
References threadschedule::unexpected().
Referenced by threadschedule::detail::scheduled_pool_backend_base< PoolType >::scheduled_task_info::advance(), threadschedule::detail::scheduled_pool_backend_base< thread_pool_backend >::schedule_after(), threadschedule::detail::scheduled_pool_backend_base< thread_pool_backend >::schedule_after(), threadschedule::detail::scheduled_pool_backend_base< thread_pool_backend >::schedule_periodic_after(), threadschedule::detail::scheduled_pool_backend_base< thread_pool_backend >::schedule_periodic_after(), and shutdown_deadline_after().
|
inlinenodiscard |
Definition at line 16 of file time.hpp.
References threadschedule::unexpected().
Referenced by threadschedule::detail::scheduled_pool_facade<::threadschedule::detail::scheduled_pool_backend >::schedule_after(), threadschedule::scheduled_pool::schedule_after(), threadschedule::detail::scheduled_pool_facade<::threadschedule::detail::scheduled_pool_backend >::schedule_periodic(), threadschedule::scheduled_pool::schedule_periodic(), threadschedule::detail::scheduled_pool_facade<::threadschedule::detail::scheduled_pool_backend >::schedule_periodic_after(), threadschedule::scheduled_pool::schedule_periodic_after(), and shutdown_deadline_after().
|
inlinenodiscard |
Definition at line 18 of file detail/pool/worker_count.hpp.
Referenced by threadschedule::detail::lightweight_pool_backend_base< TaskSize >::lightweight_pool_backend_base(), threadschedule::detail::thread_pool_backend_base< indefinite_wait >::thread_pool_backend_base(), and threadschedule::detail::work_stealing_pool_backend::work_stealing_pool_backend().
|
inline |
Definition at line 176 of file thread_backend.hpp.
References threadschedule::thread::configure(), threadschedule::thread::set_affinity(), threadschedule::thread::set_name(), and threadschedule::unexpected().
|
inline |
Definition at line 165 of file thread_backend.hpp.
References threadschedule::thread::set_name(), and threadschedule::unexpected().
Referenced by threadschedule::detail::basic_thread_backend< ThreadType, OwnershipTag >::configure(), threadschedule::detail::thread_info::configure(), and threadschedule::detail::scheduled_pool_backend_base< thread_pool_backend >::configure_scheduler_thread().
|
inline |
Definition at line 144 of file worker_context_guard.hpp.
References threadschedule::unexpected(), and worker_thread_name().
|
inline |
Definition at line 120 of file worker_context_guard.hpp.
References threadschedule::unexpected(), and worker_thread_name().
Referenced by threadschedule::detail::lightweight_pool_backend_base< TaskSize >::configure_threads(), threadschedule::detail::lightweight_pool_backend_base< TaskSize >::configure_threads(), threadschedule::detail::thread_pool_backend_base< indefinite_wait >::configure_threads(), threadschedule::detail::thread_pool_backend_base< indefinite_wait >::configure_threads(), threadschedule::detail::work_stealing_pool_backend::configure_threads(), and threadschedule::detail::work_stealing_pool_backend::configure_threads().
|
inlinenodiscardnoexcept |
Definition at line 14 of file try_result.hpp.
Referenced by try_result().
|
inlinenodiscardnoexcept |
Definition at line 64 of file thread_backend.hpp.
Referenced by threadschedule::advanced::chaos_controller::chaos_controller(), threadschedule::this_thread::get_nice(), threadschedule::this_thread::get_priority(), and threadschedule::detail::thread_backend::thread_backend().
|
inlinenodiscardnoexcept |
Definition at line 12 of file detail/pool/worker_count.hpp.
|
noexcept |
Definition at line 50 of file pool/facade.hpp.
References drain.
Referenced by threadschedule::detail::lightweight_pool_facade<::threadschedule::detail::lightweight_pool_backend >::operator=(), threadschedule::detail::submitting_pool_facade<::threadschedule::detail::polling_pool_backend >::operator=(), threadschedule::detail::lightweight_pool_facade<::threadschedule::detail::lightweight_pool_backend >::~lightweight_pool_facade(), and threadschedule::detail::submitting_pool_facade<::threadschedule::detail::polling_pool_backend >::~submitting_pool_facade().
|
inline |
Definition at line 195 of file worker_context_guard.hpp.
References threadschedule::detail::thread_info::get_affinity(), and threadschedule::unexpected().
Referenced by threadschedule::detail::lightweight_pool_backend_base< TaskSize >::distribute_across_cpus(), threadschedule::detail::thread_pool_backend_base< indefinite_wait >::distribute_across_cpus(), and threadschedule::detail::work_stealing_pool_backend::distribute_across_cpus().
|
inlinenodiscard |
Definition at line 89 of file identity.hpp.
References read_thread_start_time(), and threadschedule::unexpected().
Referenced by threadschedule::advanced::thread_by_name_view::find_all().
|
inlinenodiscard |
Definition at line 129 of file control.hpp.
Referenced by threadschedule::detail::portable_thread_control::get_affinity().
|
inlinenodiscardnoexcept |
Definition at line 123 of file control.hpp.
Referenced by threadschedule::scheduled_pool::scheduled_pool(), and threadschedule::thread_pool::thread_pool().
|
constexprnoexcept |
Definition at line 341 of file native.hpp.
Referenced by threadschedule::detail::scheduler_parameters::create_for_policy(), and resolve_scheduling_config().
|
nodiscard |
Definition at line 14 of file copyable_function.hpp.
Referenced by threadschedule::advanced::error_handler::add_callback(), threadschedule::detail::thread_registry_backend::set_on_register(), threadschedule::detail::thread_pool_backend_base< indefinite_wait >::set_on_task_end(), threadschedule::detail::work_stealing_pool_backend::set_on_task_end(), threadschedule::detail::thread_pool_backend_base< indefinite_wait >::set_on_task_start(), threadschedule::detail::work_stealing_pool_backend::set_on_task_start(), and threadschedule::detail::thread_registry_backend::set_on_unregister().
|
nodiscard |
Definition at line 171 of file move_only_function.hpp.
Referenced by threadschedule::advanced::future_with_error_handler< T >::on_error(), threadschedule::detail::scheduled_pool_backend_base< thread_pool_backend >::schedule_after(), threadschedule::detail::scheduled_pool_backend_base< thread_pool_backend >::schedule_after(), threadschedule::detail::scheduled_pool_backend_base< thread_pool_backend >::schedule_at(), threadschedule::detail::scheduled_pool_backend_base< thread_pool_backend >::schedule_at(), threadschedule::detail::scheduled_pool_backend_base< thread_pool_backend >::schedule_periodic_after(), threadschedule::detail::scheduled_pool_backend_base< thread_pool_backend >::schedule_periodic_after(), and threadschedule::detail::work_stealing_pool_backend::try_post().
|
nodiscard |
Definition at line 28 of file pool/facade.hpp.
References threadschedule::detail::work_stealing_deque< T >::default_capacity, and threadschedule::global_registry.
Referenced by threadschedule::detail::lightweight_pool_facade<::threadschedule::detail::lightweight_pool_backend >::lightweight_pool_facade(), and threadschedule::detail::submitting_pool_facade<::threadschedule::detail::polling_pool_backend >::submitting_pool_facade().
|
nodiscard |
Definition at line 41 of file scope_exit.hpp.
|
inlinenodiscard |
Definition at line 68 of file worker_context_guard.hpp.
References is_forward_iterator_v.
Referenced by threadschedule::detail::lightweight_pool_backend_base< TaskSize >::try_post_batch(), threadschedule::detail::thread_pool_backend_base< indefinite_wait >::try_submit_batch(), and threadschedule::detail::work_stealing_pool_backend::try_submit_batch().
|
inlinenodiscardnoexcept |
Definition at line 74 of file identity.hpp.
References read_thread_start_time().
Referenced by threadschedule::advanced::thread_by_name_view::alive().
| void threadschedule::detail::parallel_for_each | ( | Container & | container, |
| F && | func ) |
Convenience wrapper that applies a callable to every element of a container in parallel using the global_thread_pool_backend singleton.
Equivalent to:
The call blocks until every element has been processed.
| Container | Any type exposing begin() / end() iterators. |
| F | Callable compatible with void(Container::value_type&). |
| container | The container whose elements will be processed. |
| func | The callable applied to each element. |
Definition at line 185 of file global_pool_backend.hpp.
References threadschedule::detail::global_pool_backend< thread_pool_backend >::parallel_for_each().
|
inline |
Definition at line 220 of file worker_context_guard.hpp.
References is_forward_iterator_v.
Referenced by threadschedule::detail::thread_pool_backend_base< indefinite_wait >::parallel_for_each(), and threadschedule::detail::work_stealing_pool_backend::parallel_for_each().
|
inline |
Definition at line 15 of file native.hpp.
|
inline |
Definition at line 181 of file native.hpp.
|
inline |
|
inline |
Definition at line 847 of file native.hpp.
References idle, read_nice_value(), read_scheduling_policy(), threadschedule::unexpected(), and uses_nice_value().
Referenced by threadschedule::advanced::thread_by_name_view::get_nice(), threadschedule::this_thread::get_nice(), threadschedule::detail::basic_thread_backend< ThreadType, OwnershipTag >::get_nice_value(), threadschedule::detail::thread_control_block::get_nice_value(), threadschedule::advanced::thread_by_name_view::get_priority(), and threadschedule::this_thread::get_priority().
|
inline |
Definition at line 164 of file native.hpp.
|
inline |
Definition at line 69 of file native.hpp.
Referenced by threadschedule::advanced::thread_by_name_view::get_name(), threadschedule::detail::basic_thread_backend< ThreadType, OwnershipTag >::get_name(), and threadschedule::detail::thread_info::get_name().
|
inline |
Definition at line 207 of file native.hpp.
Referenced by read_effective_nice().
|
inline |
Definition at line 198 of file native.hpp.
|
inline |
Definition at line 97 of file native.hpp.
Referenced by threadschedule::detail::thread_info::get_priority().
|
inline |
Definition at line 219 of file native.hpp.
|
inline |
Definition at line 107 of file native.hpp.
Referenced by threadschedule::detail::thread_info::get_policy(), and read_effective_nice().
|
inlinenodiscardnoexcept |
Definition at line 41 of file identity.hpp.
Referenced by threadschedule::detail::thread_control_block::create_for_current_thread(), find_native_threads_by_name(), and native_thread_is_alive().
|
nodiscardconstexprnoexcept |
Definition at line 353 of file native.hpp.
References background, threadschedule::detail::native_thread_priority::highest(), idle, intent, interactive, is_realtime_policy(), low_latency, threadschedule::detail::native_thread_priority::lowest(), normal, threadschedule::detail::native_thread_priority::normal(), other, posix_realtime, realtime, and rr.
Referenced by apply_scheduling_config().
|
inline |
Definition at line 649 of file thread_registry_backend.hpp.
References runtime_set_external_registry().
|
inline |
Definition at line 664 of file thread_registry_backend.hpp.
Referenced by threadschedule::global_registry_binding::global_registry_binding().
|
inline |
Definition at line 674 of file thread_registry_backend.hpp.
Referenced by threadschedule::thread_registry::operator=().
|
inline |
Definition at line 632 of file thread_registry_backend.hpp.
Referenced by threadschedule::detail::lightweight_pool_backend_base< TaskSize >::configure_threads(), threadschedule::detail::lightweight_pool_backend_base< TaskSize >::configure_threads(), threadschedule::detail::thread_pool_backend_base< indefinite_wait >::configure_threads(), threadschedule::detail::thread_pool_backend_base< indefinite_wait >::configure_threads(), threadschedule::detail::work_stealing_pool_backend::configure_threads(), threadschedule::detail::work_stealing_pool_backend::configure_threads(), threadschedule::thread_registry::operator=(), and threadschedule::detail::registration_guard_backend::registration_guard_backend().
|
inline |
Definition at line 642 of file thread_registry_backend.hpp.
Referenced by threadschedule::thread_registry::operator=(), and runtime_exchange_external_registry().
|
inline |
Definition at line 658 of file thread_registry_backend.hpp.
Referenced by threadschedule::thread_registry::operator=().
|
inline |
Definition at line 179 of file worker_context_guard.hpp.
References threadschedule::unexpected().
Referenced by threadschedule::detail::lightweight_pool_backend_base< TaskSize >::set_affinity(), threadschedule::detail::thread_pool_backend_base< indefinite_wait >::set_affinity(), and threadschedule::detail::work_stealing_pool_backend::set_affinity().
|
inlinenodiscard |
Definition at line 11 of file deadline.hpp.
References checked_deadline_after(), and checked_duration_cast().
Referenced by threadschedule::detail::lightweight_pool_backend_base< TaskSize >::shutdown_for(), threadschedule::detail::thread_pool_backend_base< indefinite_wait >::shutdown_for(), and threadschedule::detail::work_stealing_pool_backend::shutdown_for().
|
nodiscardnoexcept |
Definition at line 41 of file task_group.hpp.
Referenced by threadschedule::advanced::task_group< Pool >::submit().
|
inline |
Definition at line 98 of file worker_context_guard.hpp.
Referenced by threadschedule::detail::thread_pool_backend_base< indefinite_wait >::parallel_for_each(), threadschedule::detail::work_stealing_pool_backend::parallel_for_each(), threadschedule::detail::lightweight_pool_backend_base< TaskSize >::shutdown(), threadschedule::detail::scheduled_pool_backend_base< thread_pool_backend >::shutdown(), threadschedule::detail::thread_pool_backend_base< indefinite_wait >::shutdown(), threadschedule::detail::work_stealing_pool_backend::shutdown(), threadschedule::detail::lightweight_pool_backend_base< TaskSize >::shutdown_for(), threadschedule::detail::thread_pool_backend_base< indefinite_wait >::shutdown_for(), threadschedule::detail::work_stealing_pool_backend::shutdown_for(), threadschedule::detail::thread_pool_backend_base< indefinite_wait >::wait_for_tasks(), and threadschedule::detail::work_stealing_pool_backend::wait_for_tasks().
|
nodiscardconstexprnoexcept |
Definition at line 75 of file control.hpp.
References threadschedule::detail::native_schedule::background(), threadschedule::background, threadschedule::detail::native_schedule::interactive(), threadschedule::interactive, threadschedule::detail::native_schedule::low_latency(), threadschedule::low_latency, threadschedule::nice, threadschedule::detail::native_schedule::normal(), threadschedule::normal, threadschedule::detail::native_schedule::posix_nice(), threadschedule::detail::native_schedule::realtime_fifo(), threadschedule::realtime_fifo, threadschedule::realtime_round_robin, and threadschedule::detail::native_schedule::realtime_rr().
|
nodiscardconstexprnoexcept |
Definition at line 10 of file shutdown.hpp.
References drain, drop_pending, and threadschedule::drop_pending.
Referenced by threadschedule::advanced::thread_by_name_view::configure(), threadschedule::detail::portable_thread_control::configure(), threadschedule::thread_registry::configure(), threadschedule::detail::scheduled_pool_facade<::threadschedule::detail::scheduled_pool_backend >::configure_scheduler(), threadschedule::detail::lightweight_pool_facade<::threadschedule::detail::lightweight_pool_backend >::configure_workers(), threadschedule::detail::scheduled_pool_facade<::threadschedule::detail::scheduled_pool_backend >::configure_workers(), threadschedule::detail::submitting_pool_facade<::threadschedule::detail::polling_pool_backend >::configure_workers(), threadschedule::thread_pool::configure_workers(), threadschedule::advanced::thread_by_name_view::set_affinity(), threadschedule::detail::portable_thread_control::set_affinity(), threadschedule::advanced::inline_pool::shutdown(), threadschedule::detail::lightweight_pool_facade<::threadschedule::detail::lightweight_pool_backend >::shutdown(), threadschedule::detail::scheduled_pool_facade<::threadschedule::detail::scheduled_pool_backend >::shutdown(), threadschedule::detail::submitting_pool_facade<::threadschedule::detail::polling_pool_backend >::shutdown(), threadschedule::scheduled_pool::shutdown(), threadschedule::thread_pool::shutdown(), and to_native().
|
inlinenodiscard |
Definition at line 98 of file control.hpp.
|
inlinenodiscard |
Definition at line 111 of file control.hpp.
References to_native().
|
nodiscardconstexprnoexcept |
Definition at line 32 of file control.hpp.
References threadschedule::high, threadschedule::highest, threadschedule::low, threadschedule::lowest, and threadschedule::normal.
Referenced by threadschedule::detail::portable_thread_control::get_priority(), and threadschedule::thread_registry::get_priority().
|
inline |
|
nodiscard |
Definition at line 36 of file try_result.hpp.
References current_exception_error_code(), and threadschedule::unexpected().
Referenced by threadschedule::advanced::thread_by_name_view::configure(), threadschedule::detail::portable_thread_control::configure(), threadschedule::thread_registry::configure(), threadschedule::detail::scheduled_pool_facade<::threadschedule::detail::scheduled_pool_backend >::configure_scheduler(), threadschedule::detail::lightweight_pool_facade<::threadschedule::detail::lightweight_pool_backend >::configure_workers(), threadschedule::detail::scheduled_pool_facade<::threadschedule::detail::scheduled_pool_backend >::configure_workers(), threadschedule::detail::submitting_pool_facade<::threadschedule::detail::polling_pool_backend >::configure_workers(), threadschedule::thread_pool::configure_workers(), threadschedule::advanced::thread_by_name_view::create(), threadschedule::thread::create(), threadschedule::thread::create(), threadschedule::thread_registry::create(), threadschedule::detail::thread_lifecycle::detach(), threadschedule::detail::lightweight_pool_facade<::threadschedule::detail::lightweight_pool_backend >::distribute_workers(), threadschedule::detail::submitting_pool_facade<::threadschedule::detail::polling_pool_backend >::distribute_workers(), threadschedule::advanced::thread_by_name_view::find_all(), threadschedule::thread_registry::get_nice(), threadschedule::thread_registry::get_priority(), threadschedule::detail::thread_lifecycle::join(), threadschedule::advanced::inline_pool::parallel_for_each(), threadschedule::detail::submitting_pool_facade<::threadschedule::detail::polling_pool_backend >::parallel_for_each(), threadschedule::detail::lightweight_pool_facade<::threadschedule::detail::lightweight_pool_backend >::post(), threadschedule::detail::submitting_pool_facade<::threadschedule::detail::polling_pool_backend >::post(), threadschedule::thread_pool::post(), threadschedule::detail::scheduled_pool_facade<::threadschedule::detail::scheduled_pool_backend >::schedule_after(), threadschedule::scheduled_pool::schedule_after(), threadschedule::detail::scheduled_pool_facade<::threadschedule::detail::scheduled_pool_backend >::schedule_at(), threadschedule::scheduled_pool::schedule_at(), threadschedule::detail::scheduled_pool_facade<::threadschedule::detail::scheduled_pool_backend >::schedule_periodic(), threadschedule::scheduled_pool::schedule_periodic(), threadschedule::detail::scheduled_pool_facade<::threadschedule::detail::scheduled_pool_backend >::schedule_periodic_after(), threadschedule::scheduled_pool::schedule_periodic_after(), threadschedule::advanced::thread_by_name_view::set_affinity(), threadschedule::detail::portable_thread_control::set_affinity(), threadschedule::thread_registry::set_nice(), threadschedule::detail::lightweight_pool_facade<::threadschedule::detail::lightweight_pool_backend >::shutdown(), threadschedule::detail::scheduled_pool_facade<::threadschedule::detail::scheduled_pool_backend >::shutdown(), threadschedule::detail::submitting_pool_facade<::threadschedule::detail::polling_pool_backend >::shutdown(), threadschedule::scheduled_pool::shutdown(), threadschedule::thread_pool::shutdown(), threadschedule::detail::lightweight_pool_facade<::threadschedule::detail::lightweight_pool_backend >::shutdown_for(), threadschedule::detail::submitting_pool_facade<::threadschedule::detail::polling_pool_backend >::shutdown_for(), threadschedule::thread_registry::snapshot(), threadschedule::detail::submitting_pool_facade<::threadschedule::detail::polling_pool_backend >::submit(), threadschedule::thread_pool::submit(), threadschedule::detail::submitting_pool_facade<::threadschedule::detail::polling_pool_backend >::submit_batch(), threadschedule::thread_registry::unregister_current_thread(), threadschedule::detail::submitting_pool_facade<::threadschedule::detail::polling_pool_backend >::wait(), and threadschedule::thread_pool::wait().
|
constexprnoexcept |
Definition at line 347 of file native.hpp.
Referenced by read_effective_nice().
|
inline |
Definition at line 105 of file worker_context_guard.hpp.
Referenced by configure_worker_threads(), and configure_worker_threads().
| class THREADSCHEDULE_POINTER threadschedule::detail::function_ref |
Definition at line 20 of file function_ref.hpp.
|
inlineconstexpr |
Definition at line 63 of file worker_context_guard.hpp.
Referenced by multipass_range_size(), threadschedule::advanced::inline_pool::parallel_for_each(), threadschedule::detail::inline_pool_backend::parallel_for_each(), and parallel_for_each_chunked().
|
inlineconstexpr |
Definition at line 124 of file expected.hpp.
|
inlineconstexpr |
Definition at line 126 of file expected.hpp.
|
inlineconstexpr |
Definition at line 129 of file expected.hpp.