pub struct PerCpuScheduler { /* private fields */ }Expand description
Per-CPU scheduler managing all CPU queues.
Implementations§
Source§impl PerCpuScheduler
impl PerCpuScheduler
Sourcepub fn set_cpu_count(&self, count: u32)
pub fn set_cpu_count(&self, count: u32)
Set the number of active CPUs.
Sourcepub fn pop(&self, cpu_id: usize) -> Option<ProcessId>
pub fn pop(&self, cpu_id: usize) -> Option<ProcessId>
Pop the next process from a specific CPU’s queue.
Sourcepub fn steal_for(&self, cpu_id: usize) -> Option<ProcessId>
pub fn steal_for(&self, cpu_id: usize) -> Option<ProcessId>
Try to steal work from another CPU.
Finds the busiest CPU and steals half its tasks.
Sourcepub fn find_least_loaded(&self) -> usize
pub fn find_least_loaded(&self) -> usize
Find the least-loaded CPU.
Sourcepub fn queue_length(&self, cpu_id: usize) -> u32
pub fn queue_length(&self, cpu_id: usize) -> u32
Get queue length for a specific CPU.