ThreadSchedule 3.0.0
Modern C++ thread management library
Loading...
Searching...
No Matches
threadschedule::detail Namespace Reference

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.

Header-only mode (default)
The runtime registry functions are inline and use function-local statics. runtime_registry() returns the installed backend when one exists, otherwise a function-local default instance.
Runtime / shared-library mode (THREADSCHEDULE_RUNTIME defined)
The functions are declared here but defined in runtime_registry.cpp. This ensures a single registry instance across shared-library boundaries even when the header is included from multiple translation units in different DSOs.
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>
 

Detailed Description

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.

Thread safety
All public methods are thread-safe. The internal list of attached registries is protected by a std::mutex.
Copyability / movability
Not copyable and not movable (holds a std::mutex).
Ownership
attach() stores raw pointers to the supplied registries. The caller is responsible for ensuring that every attached thread_registry_backend outlives this composite_thread_registry_backend. Violating this results in undefined behaviour.
Deduplication
No deduplication is performed. If the same TID appears in multiple attached registries, it will appear multiple times in the merged query_view.
Querying
query() iterates over every attached registry, calls its own query(), and concatenates the results into a single thread_registry_backend::query_view snapshot. The same functional-style helpers (filter, map, for_each, etc.) are inherited from the detail::query_facade_mixin implementation.

Typedef Documentation

◆ bind_result_t

template<typename F , typename... Args>
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.

Definition at line 32 of file bind.hpp.

◆ copyable_function

template<typename Signature >
using threadschedule::detail::copyable_function = typedef std::function<Signature>

Definition at line 10 of file copyable_function.hpp.

◆ global_thread_pool_backend

Singleton accessor for the process-wide thread_pool_backend instance.

Definition at line 155 of file global_pool_backend.hpp.

◆ global_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.

◆ lightweight_pool_backend

Default lightweight pool with 64-byte task slots (56 bytes usable).

Sufficient for lambdas capturing up to ~7 pointers on 64-bit platforms.

See also
lightweight_pool_backend_base

Definition at line 488 of file lightweight_pool_backend_base.hpp.

◆ native_thread_id

Definition at line 44 of file native.hpp.

◆ polling_pool_backend

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.

See also
thread_pool_backend_base, polling_wait

Definition at line 715 of file thread_pool_backend_base.hpp.

◆ registry_callback

◆ remove_cvref_t

template<typename T >
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.

◆ scheduled_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.

◆ scheduled_polling_pool_backend

◆ scheduled_pool_backend

◆ scheduled_work_stealing_pool_backend

◆ task_end_callback

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.

◆ task_end_callback_storage

◆ task_start_callback

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.

◆ task_start_callback_storage

◆ thread_pool_backend

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.

See also
thread_pool_backend_base, indefinite_wait

Definition at line 704 of file thread_pool_backend_base.hpp.

Enumeration Type Documentation

◆ native_priority_model

enum class threadschedule::detail::native_priority_model : std::uint_fast8_t
strong
Enumerator
intent 
posix_nice 
posix_realtime 
windows_thread 
platform_native 

Definition at line 242 of file native.hpp.

◆ native_scheduling_intent

enum class threadschedule::detail::native_scheduling_intent : std::uint_fast8_t
strong
Enumerator
background 
normal 
interactive 
low_latency 
realtime 

Definition at line 233 of file native.hpp.

◆ native_scheduling_policy

enum class threadschedule::detail::native_scheduling_policy : std::uint_fast8_t
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.

Linux behaviour

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 behaviour

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.

Note
DEADLINE is only available on Linux when SCHED_DEADLINE is defined by the kernel headers. It is not available on Windows.
Warning
Setting FIFO or RR without adequate privileges will fail with a permission error (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.

◆ shutdown_policy_backend

enum class threadschedule::detail::shutdown_policy_backend : std::uint8_t
strong
Enumerator
drain 
drop_pending 

Definition at line 12 of file shutdown_policy_backend.hpp.

Function Documentation

◆ apply_affinity_checked()

◆ apply_scheduling_config()

◆ bind_args()

◆ checked_deadline_after()

◆ checked_duration_cast()

template<typename ToDuration , typename Rep , typename Period >
auto threadschedule::detail::checked_duration_cast ( std::chrono::duration< Rep, Period >  value) -> expected<ToDuration, std::error_code>
inline

Definition at line 16 of file time.hpp.

◆ checked_worker_count()

auto threadschedule::detail::checked_worker_count ( std::size_t  count) -> std::size_t
inline

Definition at line 18 of file detail/pool/worker_count.hpp.

◆ configure_thread() [1/2]

template<typename ThreadLike >
auto threadschedule::detail::configure_thread ( ThreadLike &  thread,
native_thread_config const &  config 
) -> expected<void, std::error_code>
inline

◆ configure_thread() [2/2]

template<typename ThreadLike >
auto threadschedule::detail::configure_thread ( ThreadLike &  thread,
std::string const &  name,
native_scheduling_policy  policy,
native_thread_priority  priority 
) -> expected<void, std::error_code>
inline

◆ configure_worker_threads() [1/2]

template<typename WorkerRange >
auto threadschedule::detail::configure_worker_threads ( WorkerRange &  workers,
native_thread_config const &  config,
thread_registry_backend registry = nullptr 
) -> expected<void, std::error_code>
inline

Definition at line 144 of file worker_context_guard.hpp.

References worker_thread_name().

◆ configure_worker_threads() [2/2]

◆ current_exception_error_code()

auto threadschedule::detail::current_exception_error_code ( ) -> std::error_code
inlinenoexcept

Definition at line 14 of file try_result.hpp.

Referenced by try_result().

◆ current_native_thread_id()

◆ default_worker_count()

auto threadschedule::detail::default_worker_count ( ) -> std::size_t
inlinenoexcept

Definition at line 12 of file detail/pool/worker_count.hpp.

◆ dispose_pool_backend()

◆ distribute_workers_across_cpus()

◆ find_native_threads_by_name()

auto threadschedule::detail::find_native_threads_by_name ( std::string_view  name) -> result<std::vector<native_thread_identity>>
inline

◆ from_native()

auto threadschedule::detail::from_native ( native_thread_affinity const &  affinity) -> thread_affinity
inline

Definition at line 129 of file control.hpp.

◆ has_thread_configuration()

auto threadschedule::detail::has_thread_configuration ( thread_config const &  config) -> bool
inlinenoexcept

◆ is_realtime_policy()

constexpr auto threadschedule::detail::is_realtime_policy ( native_scheduling_policy  policy) -> bool
constexprnoexcept

◆ make_copyable_function()

template<typename Signature , typename Callable >
auto threadschedule::detail::make_copyable_function ( Callable &&  callable) -> copyable_function<Signature>

◆ make_move_only_function()

◆ make_pool_backend()

template<typename Backend >
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.

◆ make_scope_exit()

template<typename F >
auto threadschedule::detail::make_scope_exit ( F &&  function) -> scope_exit<std::decay_t<F>>

Definition at line 41 of file scope_exit.hpp.

◆ multipass_range_size()

template<typename Iterator >
auto threadschedule::detail::multipass_range_size ( Iterator  begin,
Iterator  end 
) -> size_t
inline

◆ native_thread_is_alive()

auto threadschedule::detail::native_thread_is_alive ( native_thread_identity const &  identity) -> bool
inlinenoexcept

◆ parallel_for_each()

template<typename Container , typename F >
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:

container.end(), func);
static void parallel_for_each(Iterator begin, Iterator end, F &&func)

The call blocks until every element has been processed.

Template Parameters
ContainerAny type exposing begin() / end() iterators.
FCallable compatible with void(Container::value_type&).
Parameters
containerThe container whose elements will be processed.
funcThe 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().

◆ parallel_for_each_chunked()

template<typename Pool , typename Iterator , typename F >
void threadschedule::detail::parallel_for_each_chunked ( Pool &  pool,
Iterator  begin,
Iterator  end,
F &&  func,
size_t  num_workers 
)
inline

◆ read_effective_nice()

◆ read_thread_start_time()

auto threadschedule::detail::read_thread_start_time ( native_thread_id  id) -> std::optional<std::uint64_t>
inlinenoexcept

◆ resolve_scheduling_config()

◆ runtime_exchange_external_registry()

auto threadschedule::detail::runtime_exchange_external_registry ( thread_registry_backend reg) -> thread_registry_backend*
inline

Definition at line 649 of file thread_registry_backend.hpp.

References runtime_set_external_registry().

◆ runtime_exchange_external_registry_state()

auto threadschedule::detail::runtime_exchange_external_registry_state ( std::shared_ptr< external_registry_binding_state state) -> std::shared_ptr<external_registry_binding_state>
inline

◆ runtime_external_registry_state()

auto threadschedule::detail::runtime_external_registry_state ( ) -> std::shared_ptr<external_registry_binding_state>
inline

◆ runtime_registry()

◆ runtime_set_external_registry()

void threadschedule::detail::runtime_set_external_registry ( thread_registry_backend reg)
inline

◆ runtime_set_external_registry_state()

void threadschedule::detail::runtime_set_external_registry_state ( std::shared_ptr< external_registry_binding_state state)
inline

◆ set_worker_affinity()

template<typename WorkerRange >
auto threadschedule::detail::set_worker_affinity ( WorkerRange &  workers,
native_thread_affinity const &  affinity 
) -> expected<void, std::error_code>
inline

◆ shutdown_deadline_after()

auto threadschedule::detail::shutdown_deadline_after ( std::chrono::milliseconds  timeout) -> std::chrono::steady_clock::time_point
inline

◆ task_group_is_current_worker()

template<typename Pool >
auto threadschedule::detail::task_group_is_current_worker ( Pool const &  pool) -> bool
noexcept

Definition at line 41 of file task_group.hpp.

Referenced by threadschedule::advanced::task_group< Pool >::submit().

◆ throw_worker_deadlock()

◆ to_native() [1/4]

◆ to_native() [2/4]

◆ to_native() [3/4]

auto threadschedule::detail::to_native ( thread_affinity const &  affinity) -> native_thread_affinity
inline

Definition at line 98 of file control.hpp.

◆ to_native() [4/4]

auto threadschedule::detail::to_native ( thread_config const &  config) -> native_thread_config
inline

Definition at line 111 of file control.hpp.

References to_native().

◆ to_priority_level()

constexpr auto threadschedule::detail::to_priority_level ( int  nice_value) -> priority_level
constexprnoexcept

◆ to_string()

auto threadschedule::detail::to_string ( native_scheduling_policy  policy) -> std::string
inline

String conversion utilities.

Definition at line 751 of file native.hpp.

References batch, fifo, idle, other, and rr.

◆ try_result()

template<typename Function >
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().

◆ uses_nice_value()

constexpr auto threadschedule::detail::uses_nice_value ( native_scheduling_policy  policy) -> bool
constexprnoexcept

Definition at line 347 of file native.hpp.

References batch, and other.

Referenced by read_effective_nice().

◆ worker_thread_name()

auto threadschedule::detail::worker_thread_name ( std::string const &  name_prefix,
size_t  index 
) -> std::string
inline

Definition at line 105 of file worker_context_guard.hpp.

Referenced by configure_worker_threads(), and configure_worker_threads().

Variable Documentation

◆ is_forward_iterator_v

template<typename Iterator >
constexpr bool threadschedule::detail::is_forward_iterator_v = std::is_base_of_v<std::forward_iterator_tag, typename std::iterator_traits<Iterator>::iterator_category>
inlineconstexpr

Definition at line 63 of file worker_context_guard.hpp.