|
NUMA++ 0.11.0
|
Static priority scheduler (real-time). More...
#include <numapp/scheduler.hpp>
Public Types | |
| enum class | Policy : int { Fifo = SCHED_FIFO , Rr = SCHED_RR } |
| Scheduler policy. More... | |
Public Member Functions | |
| StaticScheduler (Policy policy, int priority) | |
| Create with provided policy and priority. | |
| std::error_code | SetPriority (int priority) |
| Set static priority 0 - 99. | |
| std::error_code | SetPolicy (Policy policy) noexcept |
| Set policy. | |
| constexpr int | GetPriority () const noexcept |
| Get static priority. | |
| constexpr Policy | GetPolicy () const noexcept |
Related Symbols | |
(Note that these are not member symbols.) | |
| std::ostream & | operator<< (std::ostream &os, StaticScheduler const &scheduler) |
| Formats scheduler and inserts it to os. | |
Apply Scheduler to Specified Thread | |
Applies scheduler to specified thread. | |
| std::error_code | Apply (pid_t thread, StaticScheduler const &scheduler) noexcept |
| Apply static scheduler to specified thread. | |
Apply Scheduler to Current Thread | |
Applies specified scheduler to current thread. | |
| std::error_code | Apply (StaticScheduler const &scheduler) noexcept |
| Apply static scheduler to this thread. | |
Static priority scheduler (real-time).
Get and set scheduler for the calling thread.
The implementation use the pthread API to query and apply policy.
Real-time priority scheduler may require additional permissions provided by CAP_SYS_NICE unless allowed by resource limits (RLIMIT_RTPRIO). See also Permissions.
Definition at line 216 of file scheduler.hpp.
|
strong |
Scheduler policy.
| Enumerator | |
|---|---|
| Fifo | A first-in, first-out "real-time" policy. |
| Rr | A roound-robin, "real-time" policy. |
Definition at line 221 of file scheduler.hpp.
|
explicit |
Create with provided policy and priority.
| policy | Scheduler policy. |
| priority | Static priority with a valid range of 1 (low) to 99 (high). |
| std::system_error | containing std::errc::invalid_argument if any argument is invalid. |
|
inlineconstexprnoexcept |
Definition at line 279 of file scheduler.hpp.
|
noexcept |
Set policy.
| std::error_code numapp::StaticScheduler::SetPriority | ( | int | priority | ) |
Set static priority 0 - 99.
| priority | The priority to use. Valid range is 0 - 99. |
priority is invalid.
|
Formats scheduler and inserts it to os.
| os | output stream to insert into. |
| scheduler | StaticScheduler to format. |