pub struct CacheAwareScheduler { /* private fields */ }
Expand description
Cache-aware scheduler implementation with optimized hot paths.
Implementations§
Source§impl CacheAwareScheduler
impl CacheAwareScheduler
pub fn new(config: PerfConfig) -> Self
Sourcepub fn current_thread(&self, cpu_id: CpuId) -> Option<Arc<Thread>>
pub fn current_thread(&self, cpu_id: CpuId) -> Option<Arc<Thread>>
Hot path: Get current thread for CPU (single cache line access).
Sourcepub fn schedule_next(
&self,
cpu_id: CpuId,
current: Option<Arc<Thread>>,
) -> Option<Arc<Thread>>
pub fn schedule_next( &self, cpu_id: CpuId, current: Option<Arc<Thread>>, ) -> Option<Arc<Thread>>
Hot path: Schedule next thread (optimized for cache locality).
Sourcepub fn add_to_local_queue(
&self,
cpu_id: CpuId,
thread: Arc<Thread>,
) -> Result<(), Arc<Thread>>
pub fn add_to_local_queue( &self, cpu_id: CpuId, thread: Arc<Thread>, ) -> Result<(), Arc<Thread>>
Add thread to CPU’s local queue (cache-optimized).
Sourcepub fn remove_from_local_queue(&self, cpu_id: CpuId, thread: &Thread) -> bool
pub fn remove_from_local_queue(&self, cpu_id: CpuId, thread: &Thread) -> bool
Remove thread from CPU’s local queue.
Sourcepub fn get_cpu_stats(&self, cpu_id: CpuId) -> Option<CpuStats>
pub fn get_cpu_stats(&self, cpu_id: CpuId) -> Option<CpuStats>
Get CPU utilization statistics.
Sourcepub fn get_system_stats(&self) -> SystemSchedulerStats
pub fn get_system_stats(&self) -> SystemSchedulerStats
Get system-wide scheduler statistics.
Auto Trait Implementations§
impl !Freeze for CacheAwareScheduler
impl RefUnwindSafe for CacheAwareScheduler
impl Send for CacheAwareScheduler
impl Sync for CacheAwareScheduler
impl Unpin for CacheAwareScheduler
impl !UnwindSafe for CacheAwareScheduler
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more