Normal non-realtime scheduler that use dynamic priority (nice value).
More...
#include <numapp/scheduler.hpp>
|
(Note that these are not member symbols.)
|
| std::ostream & | operator<< (std::ostream &os, DynamicScheduler const &scheduler) |
| | Formats scheduler and inserts it to os.
|
| |
| std::ostream & | operator<< (std::ostream &os, DynamicScheduler const &policy) |
| | Formats policy and inserts it to os.
|
| |
|
Applies scheduler to specified thread.
|
| std::error_code | Apply (pid_t thread, DynamicScheduler const &scheduler) noexcept |
| | Apply dynamic scheduler to specified thread.
|
| |
|
Applies specified scheduler to current thread.
|
| std::error_code | Apply (DynamicScheduler const &scheduler) noexcept |
| | Apply dynamic scheduler to this thread.
|
| |
Normal non-realtime scheduler that use dynamic priority (nice value).
- Note
- The "nice" value is a type of inverse dynamic scheduling priority where lower values (less nice) have higher priority.
To apply a lower value requires CAP_SYS_NICE privilege.
- Related man-page(s):
-
Definition at line 326 of file scheduler.hpp.
◆ Policy
Sheduler policy.
| Enumerator |
|---|
| Other | The standard round-robin time-sharing policy.
This is referred to as SCHED_NORMAL in the kernel.
|
| Batch | For "batch" style execution of processes.
|
Definition at line 331 of file scheduler.hpp.
◆ DynamicScheduler()
- Parameters
-
| policy | Scheduling policy. |
| nice | Niceness value with range [-20 - 19], where -20 is the highest priority and 19 lowest priority. |
- Exceptions
-
| std::system_error | with std::errc::invalid_argument on error. |
◆ GetPolicy()
| Policy numapp::DynamicScheduler::GetPolicy |
( |
| ) |
const |
|
inlineconstexprnoexcept |
◆ SetNice()
| std::error_code numapp::DynamicScheduler::SetNice |
( |
int | value | ) |
|
|
noexcept |
Set dynamic nice value (dynamic priority) of thread.
Higher value means "more" nice and correspondingly lower scheduling priority.
- Parameters
-
| value | the dynamic priority. Valid range is [-20 - 19]. |
- Returns
- std::errc::invalid_argument if value is out of range.
◆ SetPolicy()
| std::error_code numapp::DynamicScheduler::SetPolicy |
( |
Policy | policy | ) |
|
|
noexcept |
Set policy.
- Returns
- std::errc::invalid_argument if policy is invalid.
◆ operator<<() [1/2]
| std::ostream & operator<< |
( |
std::ostream & | os, |
|
|
DynamicScheduler const & | policy ) |
|
related |
Formats policy and inserts it to os.
- Parameters
-
| os | output stream to insert into. |
| policy | Policy to format. |
- Returns
- os
◆ operator<<() [2/2]
| std::ostream & operator<< |
( |
std::ostream & | os, |
|
|
DynamicScheduler const & | scheduler ) |
|
related |
Formats scheduler and inserts it to os.
- Parameters
-
- Returns
- os
The documentation for this class was generated from the following file: