pub struct Scheduler {
pub run_queue: VecDeque<TaskId>,
pub need_schedule: bool,
}
Fields§
§run_queue: VecDeque<TaskId>
§need_schedule: bool
Implementations§
Source§impl Scheduler
impl Scheduler
pub const MIN_TASK_CAP: usize = 16usize
pub const fn new() -> Self
pub fn insert_task(&mut self, tid: TaskId)
pub fn try_remove(&mut self, _tid: TaskId)
Sourcepub unsafe fn try_reschedule()
pub unsafe fn try_reschedule()
unsafe because this must be called on a linearization point on Epilogue level (l2); It will check the NEED_RESCHEDULE flag.
Sourcepub unsafe fn do_schedule()
pub unsafe fn do_schedule()
do_schedule is only called from epilogue level, so we don’t need to lock here. For cooperative scheduling call Self::yield_cpu instead.