|
ThreadSchedule 1.0.0
Modern C++ thread management library
|
Static utility class for constructing OS-native scheduling parameters. More...
#include <scheduler_policy.hpp>
Static Public Member Functions | |
| static auto | create_for_policy (SchedulingPolicy policy, ThreadPriority priority) -> expected< sched_param, std::error_code > |
| static auto | get_priority_range (SchedulingPolicy policy) -> expected< int, std::error_code > |
Static utility class for constructing OS-native scheduling parameters.
SchedulerParams translates the portable SchedulingPolicy and ThreadPriority types into the platform-specific structures required by the OS scheduling APIs (sched_param on Linux, a compatible POD on Windows).
Builds a native scheduling-parameter structure for a given policy/priority pair. The priority is clamped to the valid range for the requested policy (queried at runtime on Linux via sched_get_priority_min / sched_get_priority_max), so callers never need to pre-validate the range themselves. Returns an expected - on failure (e.g. an unrecognised policy value) an std::error_code is returned instead.
Returns the width of the valid priority range (max - min) for a policy. Useful for normalising priorities across policies.
All members are static and stateless; concurrent calls from any number of threads are safe.
Definition at line 400 of file scheduler_policy.hpp.
|
inlinestatic |
Definition at line 425 of file scheduler_policy.hpp.
|
inlinestatic |
Definition at line 443 of file scheduler_policy.hpp.