#[repr(i32)]pub enum Scheduler {
SCHED_NORMAL = 0,
SCHED_FIFO = 1,
SCHED_RR = 2,
SCHED_BATCH = 3,
SCHED_IDLE = 5,
SCHED_DEADLINE = 6,
}Expand description
The type of scheduler for use with sched_getscheduler
and sched_setscheduler.
See man_sched(7) for more details
on the differences in behavior.
This type is a wrapper around the libc::SCHED_* enum.
Variants§
SCHED_NORMAL = 0
The default scheduler on non-realtime linux - also known as SCHED_OTHER.
SCHED_FIFO = 1
The realtime FIFO scheduler. All FIFO threads have priority higher than 0 and preempt SCHED_NORMAL threads. Threads are executed in priority order, using first-in-first-out lists to handle two threads with the same priority.
SCHED_RR = 2
Round-robin scheduler, similar to SCHED_FIFO but with a time quantum.
SCHED_BATCH = 3
Batch scheduler, similar to SCHED_OTHER but assumes the thread is CPU intensive. The kernel applies a mild penalty to switching to this thread. As of Linux 2.6.16, the only valid priority is 0.
SCHED_IDLE = 5
The idle scheduler only executes the thread when there are idle CPUs. SCHED_IDLE threads have no progress guarantees.
SCHED_DEADLINE = 6
Deadline scheduler, attempting to provide guaranteed latency for requests. See the linux kernel docs for details.
Implementations§
Source§impl Scheduler
impl Scheduler
Sourcepub fn priority_max(&self) -> RtResult<c_int>
pub fn priority_max(&self) -> RtResult<c_int>
Get the highest priority value for a given scheduler.
Sourcepub fn priority_min(&self) -> RtResult<c_int>
pub fn priority_min(&self) -> RtResult<c_int>
Get the lowest priority value for a given scheduler.
Sourcepub fn with_params(self, params: SchedulerParams) -> ParameterizedScheduler
pub fn with_params(self, params: SchedulerParams) -> ParameterizedScheduler
Create a ParameterizedScheduler with the given priority.