|
ThreadSchedule 3.0.0
Modern C++ thread management library
|
Aggregates multiple thread_registry_backend instances into a single queryable view. More...
Namespaces | |
| namespace | native_schedule |
| namespace | portable_thread_control |
| namespace | thread_lifecycle |
Classes | |
| class | basic_thread_backend |
| Polymorphic base providing common thread management operations. More... | |
| class | composite_thread_registry_backend |
| struct | external_registry_binding_state |
| class | function_ref |
| class | function_ref< R(Args...)> |
| class | global_pool_backend |
| Singleton accessor for a process-wide pool instance. More... | |
| struct | has_stolen_tasks |
| struct | has_stolen_tasks< T, std::void_t< decltype(std::declval< T const & >().stolen_tasks)> > |
| 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... | |
| class | lightweight_pool_facade |
| class | move_only_function |
| class | move_only_function< R(Args...), InlineSize > |
| struct | native_scheduling_config |
| struct | native_thread_access |
| class | native_thread_affinity |
| Manages a set of CPU indices to which a thread may be bound. More... | |
| struct | native_thread_config |
| struct | native_thread_identity |
| class | native_thread_priority |
| Value-semantic wrapper for a thread scheduling priority. More... | |
| struct | non_owning_tag |
| Tag type selecting non-owning (pointer) storage in thread_storage. More... | |
| struct | owning_tag |
| Tag type selecting owning (value) storage in thread_storage. More... | |
| struct | polling_wait |
| 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... | |
| struct | registered_thread_info_backend |
| Snapshot of metadata for a single registered thread. More... | |
| class | registration_guard_backend |
| Internal movable RAII guard for worker registration. More... | |
| struct | resolved_scheduling |
| struct | scheduled_cancellation_state |
| class | scheduled_pool_backend_base |
| Thread pool augmented with delayed and periodic task scheduling. More... | |
| class | scheduled_pool_facade |
| class | scheduled_task_backend |
| Copyable handle for a cancellable scheduled task. More... | |
| class | scheduler_parameters |
| Static utility class for constructing OS-native scheduling parameters. More... | |
| class | scope_exit |
| class | submitting_pool_facade |
| 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 | thread_backend |
| Owning wrapper around std::thread with RAII join-on-destroy semantics. More... | |
| class | thread_control_block |
| Per-thread control handle for OS-level scheduling operations. More... | |
| struct | thread_id_access |
| class | thread_identity_state |
| class | thread_info |
| Lightweight handle for querying and controlling a specific OS thread. More... | |
| class | thread_pool_backend_base |
| Single-queue thread pool parameterized by its idle-wait strategy. More... | |
| class | thread_registry_backend |
| Central registry of threads indexed by OS-level thread ID (native_thread_id). More... | |
| class | thread_start_gate |
| class | thread_storage |
| class | thread_storage< ThreadType, non_owning_tag > |
| Non-owning thread storage - holds a raw pointer to an external thread. More... | |
| class | thread_storage< ThreadType, owning_tag > |
| Owning thread storage - holds the thread object by value. More... | |
| class | thread_view_backend |
| Non-owning view over an externally managed std::thread. More... | |
| class | work_stealing_deque |
| class | work_stealing_pool_backend |
| High-performance thread pool optimized for high-frequency task submission. More... | |
| class | worker_context_guard |
| class | worker_startup_latch |
Typedefs | |
| template<typename F , typename... Args> | |
| using | 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. | |
| template<typename Signature > | |
| using | copyable_function = std::function< Signature > |
| template<typename T > | |
| using | remove_cvref_t = std::remove_cv_t< std::remove_reference_t< T > > |
| using | task_start_callback = copyable_function< void(std::chrono::steady_clock::time_point, std::thread::id)> |
| using | task_end_callback = copyable_function< void(std::chrono::steady_clock::time_point, std::thread::id, std::chrono::microseconds elapsed)> |
| using | task_start_callback_storage = task_start_callback |
| using | task_end_callback_storage = task_end_callback |
| using | global_thread_pool_backend = global_pool_backend< thread_pool_backend > |
Singleton accessor for the process-wide thread_pool_backend instance. | |
| using | global_work_stealing_pool_backend = global_pool_backend< work_stealing_pool_backend > |
| Singleton accessor for the process-wide work_stealing_pool_backend instance. | |
| using | lightweight_pool_backend = lightweight_pool_backend_base<> |
| Default lightweight pool with 64-byte task slots (56 bytes usable). | |
| using | thread_pool_backend = thread_pool_backend_base< indefinite_wait > |
| General-purpose thread pool with indefinite blocking wait. | |
| using | polling_pool_backend = thread_pool_backend_base< polling_wait<> > |
| Thread pool with 10 ms polling wait for lower wake-up latency. | |
| using | registry_callback = detail::copyable_function< void(registered_thread_info_backend const &)> |
| using | scheduled_pool_backend = scheduled_pool_backend_base< thread_pool_backend > |
scheduled_pool_backend_base using the default thread_pool_backend backend. | |
| using | scheduled_work_stealing_pool_backend = scheduled_pool_backend_base< work_stealing_pool_backend > |
| scheduled_pool_backend_base using work_stealing_pool_backend as backend. | |
| using | scheduled_polling_pool_backend = scheduled_pool_backend_base< polling_pool_backend > |
scheduled_pool_backend_base using polling_pool_backend as backend. | |
| using | scheduled_lightweight_pool_backend = scheduled_pool_backend_base< lightweight_pool_backend > |
scheduled_pool_backend_base using lightweight_pool_backend as backend (minimal overhead). | |
| using | native_thread_id = pid_t |
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. | |
| 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 Iterator > | |
| constexpr bool | is_forward_iterator_v = std::is_base_of_v<std::forward_iterator_tag, typename std::iterator_traits<Iterator>::iterator_category> |
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 = typedef 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 = typedef std::function<Signature> |
Definition at line 10 of file copyable_function.hpp.
Singleton accessor for the process-wide thread_pool_backend instance.
Definition at line 155 of file global_pool_backend.hpp.
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 = typedef 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 = typedef 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 = typedef 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 = typedef 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 = typedef 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 = typedef 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 = typedef 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.
| using threadschedule::detail::task_end_callback = typedef copyable_function<void(std::chrono::steady_clock::time_point, std::thread::id, std::chrono::microseconds elapsed)> |
Definition at line 12 of file callbacks.hpp.
| using threadschedule::detail::task_end_callback_storage = typedef task_end_callback |
Definition at line 16 of file callbacks.hpp.
| using threadschedule::detail::task_start_callback = typedef 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.
SCHED_DEADLINE is defined by the kernel headers. It is not available on Windows.EPERM on Linux). DEADLINE configuration is not supported by this backend because a priority alone cannot express its runtime, deadline, and period parameters. | 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 790 of file native.hpp.
References apply_affinity(), and read_affinity().
Referenced by threadschedule::advanced::thread_by_name_view::configure(), threadschedule::detail::basic_thread_backend< ThreadType, OwnershipTag >::set_affinity(), threadschedule::detail::thread_control_block::set_affinity(), threadschedule::detail::thread_info::set_affinity(), and threadschedule::advanced::thread_by_name_view::set_affinity().
|
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(), and windows_thread.
Referenced by 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::configure(), threadschedule::advanced::thread_by_name_view::set_nice(), threadschedule::detail::basic_thread_backend< ThreadType, OwnershipTag >::set_priority(), threadschedule::detail::thread_control_block::set_priority(), threadschedule::detail::thread_info::set_priority(), and threadschedule::advanced::thread_by_name_view::set_priority().
| 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::detail::inline_pool_backend::try_post(), threadschedule::detail::lightweight_pool_backend_base< TaskSize >::try_post(), threadschedule::detail::thread_pool_backend_base< WaitPolicy >::try_post(), threadschedule::detail::work_stealing_pool_backend::try_post(), threadschedule::detail::inline_pool_backend::try_submit(), threadschedule::detail::thread_pool_backend_base< WaitPolicy >::try_submit(), and threadschedule::detail::work_stealing_pool_backend::try_submit().
|
inline |
Definition at line 50 of file time.hpp.
Referenced by threadschedule::detail::scheduled_pool_backend_base< PoolType >::scheduled_task_info::advance(), threadschedule::detail::scheduled_pool_backend_base< PoolType >::schedule_after(), threadschedule::detail::scheduled_pool_backend_base< PoolType >::schedule_after(), threadschedule::detail::scheduled_pool_backend_base< PoolType >::schedule_periodic_after(), threadschedule::detail::scheduled_pool_backend_base< PoolType >::schedule_periodic_after(), and shutdown_deadline_after().
|
inline |
|
inline |
Definition at line 18 of file detail/pool/worker_count.hpp.
|
inline |
Definition at line 176 of file thread_backend.hpp.
References threadschedule::thread::configure(), threadschedule::thread::set_affinity(), and threadschedule::thread::set_name().
|
inline |
Definition at line 165 of file thread_backend.hpp.
References threadschedule::thread::set_name().
Referenced by threadschedule::detail::basic_thread_backend< ThreadType, OwnershipTag >::configure(), threadschedule::detail::thread_info::configure(), and threadschedule::detail::scheduled_pool_backend_base< PoolType >::configure_scheduler_thread().
|
inline |
Definition at line 144 of file worker_context_guard.hpp.
References worker_thread_name().
|
inline |
Definition at line 120 of file worker_context_guard.hpp.
References worker_thread_name().
Referenced by threadschedule::detail::lightweight_pool_backend_base< TaskSize >::configure_threads(), threadschedule::detail::thread_pool_backend_base< WaitPolicy >::configure_threads(), threadschedule::detail::work_stealing_pool_backend::configure_threads(), threadschedule::detail::lightweight_pool_backend_base< TaskSize >::configure_threads(), threadschedule::detail::thread_pool_backend_base< WaitPolicy >::configure_threads(), and threadschedule::detail::work_stealing_pool_backend::configure_threads().
|
inlinenoexcept |
Definition at line 14 of file try_result.hpp.
Referenced by try_result().
|
inlinenoexcept |
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().
|
inlinenoexcept |
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< Backend >::operator=(), threadschedule::detail::submitting_pool_facade< Backend >::operator=(), threadschedule::detail::lightweight_pool_facade< Backend >::~lightweight_pool_facade(), and threadschedule::detail::submitting_pool_facade< Backend >::~submitting_pool_facade().
|
inline |
Definition at line 195 of file worker_context_guard.hpp.
References threadschedule::detail::thread_info::get_affinity().
Referenced by threadschedule::detail::lightweight_pool_backend_base< TaskSize >::distribute_across_cpus(), threadschedule::detail::thread_pool_backend_base< WaitPolicy >::distribute_across_cpus(), and threadschedule::detail::work_stealing_pool_backend::distribute_across_cpus().
|
inline |
Definition at line 89 of file identity.hpp.
References read_thread_start_time().
Referenced by threadschedule::advanced::thread_by_name_view::find_all().
|
inline |
Definition at line 129 of file control.hpp.
|
inlinenoexcept |
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().
| auto threadschedule::detail::make_copyable_function | ( | Callable && | callable | ) | -> copyable_function<Signature> |
| auto threadschedule::detail::make_move_only_function | ( | Callable && | callable | ) | -> move_only_function<Signature, InlineSize> |
Definition at line 171 of file move_only_function.hpp.
Referenced by threadschedule::detail::scheduled_pool_backend_base< PoolType >::schedule_after(), threadschedule::detail::scheduled_pool_backend_base< PoolType >::schedule_after(), threadschedule::detail::scheduled_pool_backend_base< PoolType >::schedule_at(), threadschedule::detail::scheduled_pool_backend_base< PoolType >::schedule_at(), threadschedule::detail::scheduled_pool_backend_base< PoolType >::schedule_periodic_after(), threadschedule::detail::scheduled_pool_backend_base< PoolType >::schedule_periodic_after(), and threadschedule::detail::work_stealing_pool_backend::try_post().
| auto threadschedule::detail::make_pool_backend | ( | worker_count | count, |
| worker_registration | registration | ||
| ) | -> std::unique_ptr<Backend> |
Definition at line 28 of file pool/facade.hpp.
References threadschedule::global_registry.
| auto threadschedule::detail::make_scope_exit | ( | F && | function | ) | -> scope_exit<std::decay_t<F>> |
Definition at line 41 of file scope_exit.hpp.
|
inline |
Definition at line 68 of file worker_context_guard.hpp.
Referenced by threadschedule::detail::lightweight_pool_backend_base< TaskSize >::try_post_batch(), threadschedule::detail::thread_pool_backend_base< WaitPolicy >::try_submit_batch(), and threadschedule::detail::work_stealing_pool_backend::try_submit_batch().
|
inlinenoexcept |
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< PoolType >::parallel_for_each().
|
inline |
Definition at line 220 of file worker_context_guard.hpp.
Referenced by threadschedule::detail::thread_pool_backend_base< WaitPolicy >::parallel_for_each(), and threadschedule::detail::work_stealing_pool_backend::parallel_for_each().
|
inline |
Definition at line 847 of file native.hpp.
References idle, read_nice_value(), read_scheduling_policy(), and uses_nice_value().
Referenced by threadschedule::this_thread::get_nice(), threadschedule::advanced::thread_by_name_view::get_nice(), threadschedule::detail::thread_control_block::get_nice_value(), threadschedule::detail::basic_thread_backend< ThreadType, OwnershipTag >::get_nice_value(), threadschedule::this_thread::get_priority(), and threadschedule::advanced::thread_by_name_view::get_priority().
|
inlinenoexcept |
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().
|
constexprnoexcept |
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(), threadschedule::detail::native_thread_priority::normal(), normal, other, threadschedule::detail::resolved_scheduling::policy, 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::thread_pool_backend_base< WaitPolicy >::configure_threads(), threadschedule::detail::work_stealing_pool_backend::configure_threads(), threadschedule::detail::lightweight_pool_backend_base< TaskSize >::configure_threads(), threadschedule::detail::thread_pool_backend_base< WaitPolicy >::configure_threads(), threadschedule::detail::work_stealing_pool_backend::configure_threads(), and threadschedule::thread_registry::operator=().
|
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::expected< T, E >::error().
Referenced by threadschedule::detail::lightweight_pool_backend_base< TaskSize >::set_affinity(), threadschedule::detail::thread_pool_backend_base< WaitPolicy >::set_affinity(), and threadschedule::detail::work_stealing_pool_backend::set_affinity().
|
inline |
Definition at line 11 of file deadline.hpp.
References checked_deadline_after().
Referenced by threadschedule::detail::lightweight_pool_backend_base< TaskSize >::shutdown_for(), threadschedule::detail::thread_pool_backend_base< WaitPolicy >::shutdown_for(), and threadschedule::detail::work_stealing_pool_backend::shutdown_for().
|
noexcept |
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< WaitPolicy >::parallel_for_each(), threadschedule::detail::work_stealing_pool_backend::parallel_for_each(), threadschedule::detail::lightweight_pool_backend_base< TaskSize >::shutdown(), threadschedule::detail::thread_pool_backend_base< WaitPolicy >::shutdown(), threadschedule::detail::work_stealing_pool_backend::shutdown(), threadschedule::detail::scheduled_pool_backend_base< PoolType >::shutdown(), threadschedule::detail::lightweight_pool_backend_base< TaskSize >::shutdown_for(), threadschedule::detail::thread_pool_backend_base< WaitPolicy >::shutdown_for(), threadschedule::detail::work_stealing_pool_backend::shutdown_for(), threadschedule::detail::thread_pool_backend_base< WaitPolicy >::wait_for_tasks(), and threadschedule::detail::work_stealing_pool_backend::wait_for_tasks().
|
constexprnoexcept |
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().
|
constexprnoexcept |
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::thread_registry::configure(), threadschedule::detail::scheduled_pool_facade< Backend >::configure_scheduler(), threadschedule::detail::submitting_pool_facade< Backend >::configure_workers(), threadschedule::detail::lightweight_pool_facade< Backend >::configure_workers(), threadschedule::detail::scheduled_pool_facade< Backend >::configure_workers(), threadschedule::thread_pool::configure_workers(), threadschedule::scheduled_pool::scheduled_pool(), threadschedule::advanced::thread_by_name_view::set_affinity(), threadschedule::scheduled_pool::shutdown(), threadschedule::thread_pool::shutdown(), threadschedule::advanced::inline_pool::shutdown(), threadschedule::detail::submitting_pool_facade< Backend >::shutdown(), threadschedule::detail::lightweight_pool_facade< Backend >::shutdown(), threadschedule::detail::scheduled_pool_facade< Backend >::shutdown(), threadschedule::thread_pool::thread_pool(), and to_native().
|
inline |
Definition at line 98 of file control.hpp.
|
inline |
Definition at line 111 of file control.hpp.
References to_native().
|
constexprnoexcept |
Definition at line 32 of file control.hpp.
References threadschedule::high, threadschedule::highest, threadschedule::low, threadschedule::lowest, and threadschedule::normal.
Referenced by threadschedule::thread_registry::get_priority().
|
inline |
| auto threadschedule::detail::try_result | ( | Function && | function | ) | -> decltype(std::forward<Function>(function)()) |
Definition at line 36 of file try_result.hpp.
References current_exception_error_code().
Referenced by threadschedule::advanced::thread_by_name_view::configure(), threadschedule::thread_registry::configure(), threadschedule::detail::scheduled_pool_facade< Backend >::configure_scheduler(), threadschedule::detail::submitting_pool_facade< Backend >::configure_workers(), threadschedule::detail::lightweight_pool_facade< Backend >::configure_workers(), threadschedule::detail::scheduled_pool_facade< Backend >::configure_workers(), threadschedule::thread_pool::configure_workers(), threadschedule::thread_registry::create(), threadschedule::thread::create(), threadschedule::advanced::thread_by_name_view::create(), threadschedule::thread::create(), threadschedule::detail::submitting_pool_facade< Backend >::distribute_workers(), threadschedule::detail::lightweight_pool_facade< Backend >::distribute_workers(), threadschedule::advanced::thread_by_name_view::find_all(), threadschedule::thread_registry::get_nice(), threadschedule::thread_registry::get_priority(), threadschedule::advanced::inline_pool::parallel_for_each(), threadschedule::detail::submitting_pool_facade< Backend >::parallel_for_each(), threadschedule::detail::submitting_pool_facade< Backend >::post(), threadschedule::detail::lightweight_pool_facade< Backend >::post(), threadschedule::thread_pool::post(), threadschedule::detail::scheduled_pool_facade< Backend >::schedule_after(), threadschedule::scheduled_pool::schedule_after(), threadschedule::detail::scheduled_pool_facade< Backend >::schedule_at(), threadschedule::scheduled_pool::schedule_at(), threadschedule::detail::scheduled_pool_facade< Backend >::schedule_periodic(), threadschedule::scheduled_pool::schedule_periodic(), threadschedule::detail::scheduled_pool_facade< Backend >::schedule_periodic_after(), threadschedule::scheduled_pool::schedule_periodic_after(), threadschedule::advanced::thread_by_name_view::set_affinity(), threadschedule::thread_registry::set_nice(), threadschedule::scheduled_pool::shutdown(), threadschedule::thread_pool::shutdown(), threadschedule::detail::submitting_pool_facade< Backend >::shutdown(), threadschedule::detail::lightweight_pool_facade< Backend >::shutdown(), threadschedule::detail::scheduled_pool_facade< Backend >::shutdown(), threadschedule::detail::submitting_pool_facade< Backend >::shutdown_for(), threadschedule::detail::lightweight_pool_facade< Backend >::shutdown_for(), threadschedule::thread_registry::snapshot(), threadschedule::detail::submitting_pool_facade< Backend >::submit(), threadschedule::thread_pool::submit(), threadschedule::detail::submitting_pool_facade< Backend >::submit_batch(), threadschedule::thread_registry::unregister_current_thread(), threadschedule::detail::submitting_pool_facade< 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().
|
inlineconstexpr |
Definition at line 63 of file worker_context_guard.hpp.