feat(domain): add MultiCoreScheduler with placement tracking, priority preemption, and load balancing

This commit is contained in:
2026-10-17 23:31:22 +02:00
parent 14b18f7406
commit edb924c27a
5 changed files with 253 additions and 3 deletions

View File

@@ -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
}
}