skip to Main Content

Rcore Gangs -

/// Called when a task becomes runnable (e.g., wakes from I/O or is created) pub fn notify_task_ready(&mut self, tid: usize) if let Some(&gang_id) = self.task_to_gang.get(&tid) &m

impl Scheduler for HybridScheduler fn push(&mut self, task: Arc<TaskControlBlock>) if let Some(gang_id) = self.gang_sched.task_to_gang.get(&task.tid) self.gang_sched.notify_task_ready(task.tid); else self.inner.push(task); rcore gangs

Modify your existing scheduler (e.g., RoundRobinScheduler ) to wrap gang logic: /// Called when a task becomes runnable (e

fn next(&mut self) -> Option<Arc<TaskControlBlock>> if let Some(tid) = self.gang_sched.pick_next_task() return find_task_by_tid(tid); self.inner.next() Modify your existing scheduler (e.g.

It sounds like you're referring to (the educational OS kernel written in Rust, often used in Tsinghua University’s OS courses) and gangs in the context of parallel computing or OS process groups (e.g., gang scheduling).

impl GangScheduler pub fn new() -> Self Self gangs: BTreeMap::new(), task_to_gang: BTreeMap::new(), ready_gangs: VecDeque::new(),

pub struct GangScheduler gangs: BTreeMap<usize, Arc<Mutex<Gang>>>, task_to_gang: BTreeMap<usize, usize>, ready_gangs: VecDeque<usize>, // queue of gang IDs ready to run

Back To Top