refactor(kernel): split ipc/memory/lib/thread by concern; trim comments
This commit is contained in:
@@ -1,9 +1,5 @@
|
||||
//! Cores. Every thread has a home core, chosen when it is created, and
|
||||
//! only ever runs there: it waits in that core's run queue and is never
|
||||
//! migrated. Making a thread ready from another core sends that core an
|
||||
//! IPI when it has to look at its queue again (it is idle, or the thread
|
||||
//! outranks what it is running), and so does taking away the thread a
|
||||
//! core is running.
|
||||
//! Cores: each thread has a home core and never migrates; waking or removing a thread on
|
||||
//! another core sends that core an IPI when it must re-check its queue.
|
||||
|
||||
use domain::{
|
||||
scheduler::{Scheduler, SchedulerDecision},
|
||||
@@ -88,10 +84,8 @@ impl<P: Platform> Kernel<P> {
|
||||
self.threads.get(tid).ok().map(|t| t.priority())
|
||||
}
|
||||
|
||||
/// What `core` should do after an IPI: keep running its thread, or
|
||||
/// switch to a higher-priority one now waiting. When it has no thread
|
||||
/// (it was idle, or its thread was destroyed) the caller picks the
|
||||
/// next one itself.
|
||||
/// What `core` does after an IPI: keep its thread or switch to a higher-priority one;
|
||||
/// with no thread the caller picks.
|
||||
pub fn reschedule(&mut self, core: CoreId) -> SchedulerDecision {
|
||||
let Some(current) = self.scheduler.current(core) else {
|
||||
return SchedulerDecision::Continue;
|
||||
|
||||
Reference in New Issue
Block a user