pub enum SchedulePolicy {
KernelStop,
Fair {
nice: Nice,
mode: FairMode,
},
Fifo {
priority: RtPriority,
},
RoundRobin {
priority: RtPriority,
quantum_ns: u64,
},
Deadline(DeadlinePolicy),
}Expand description
Base scheduling policy of a thread.
Variants§
KernelStop
Per-CPU kernel stopper work, above Deadline and POSIX RT classes.
This class is reserved for runtime-owned workers that implement Linux CPU-stopper semantics. User-facing policy adapters must not construct it.
Fair
EEVDF fair scheduling.
Fifo
Fixed-priority first-in/first-out scheduling.
Fields
priority: RtPriorityPOSIX RT priority.
RoundRobin
Fixed-priority round-robin scheduling.
Deadline(DeadlinePolicy)
Earliest-deadline-first scheduling with CBS accounting.
Implementations§
Source§impl SchedulePolicy
impl SchedulePolicy
Sourcepub const fn validate(self) -> Result<(), TaskError>
pub const fn validate(self) -> Result<(), TaskError>
Validates policy fields that remain directly constructible through enum variants.
Sourcepub const fn fifo(priority: RtPriority) -> Self
pub const fn fifo(priority: RtPriority) -> Self
Creates a FIFO policy.
Sourcepub const fn round_robin(priority: RtPriority) -> Self
pub const fn round_robin(priority: RtPriority) -> Self
Creates a round-robin policy with the Linux default 100 ms quantum.
Sourcepub const fn round_robin_with_quantum(
priority: RtPriority,
quantum_ns: u64,
) -> Result<Self, TaskError>
pub const fn round_robin_with_quantum( priority: RtPriority, quantum_ns: u64, ) -> Result<Self, TaskError>
Creates a round-robin policy with an explicit quantum.
Sourcepub const fn deadline(policy: DeadlinePolicy) -> Self
pub const fn deadline(policy: DeadlinePolicy) -> Self
Creates a Deadline policy.
Sourcepub const fn class_rank(&self) -> u8
pub const fn class_rank(&self) -> u8
Returns the strict scheduler class rank, where smaller values run first.
Linux maps SCHED_IDLE onto fair_sched_class: Normal, Batch, and Idle
policy tasks share this rank and compete inside one EEVDF tree. The
per-CPU dedicated idle thread is not a policy class and remains the
dispatch layer’s last-choice fallback.
Trait Implementations§
Source§impl Clone for SchedulePolicy
impl Clone for SchedulePolicy
Source§fn clone(&self) -> SchedulePolicy
fn clone(&self) -> SchedulePolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more