feat(domain): add MultiCoreScheduler with placement tracking, priority preemption, and load balancing
This commit is contained in:
@@ -43,10 +43,15 @@ impl PerCoreScheduler {
|
||||
self.current = None;
|
||||
}
|
||||
|
||||
pub fn highest_waiting_priority(&self) -> Option<Priority> {
|
||||
self.queue.highest_priority()
|
||||
}
|
||||
|
||||
pub fn steal_lowest(&mut self) -> Option<(ThreadId, Priority)> {
|
||||
self.queue.steal_lowest()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
// for load balancing — count of ready threads
|
||||
// could track this incrementally instead of computing
|
||||
// but for now, bitmap popcount works
|
||||
self.queue.bitmap().count_ones() as usize
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user