pub trait Scheduler {
    // Required methods
    fn next_to_run(&self) -> Option<Box<Thread>>;
    fn push_to_queue(&self, th: Box<Thread>);
    fn timer_tick(&self);
}
Expand description

Common features of thread scheduler.

Required Methods§

source

fn next_to_run(&self) -> Option<Box<Thread>>

Peek a next thread to run.

If there is no thread to run, returns None.

source

fn push_to_queue(&self, th: Box<Thread>)

Push a thread th into scheduling queue.

source

fn timer_tick(&self)

Called on every timer interrupt (1ms).

Implementations§

source§

impl dyn Scheduler

source

pub fn reschedule(&self)

Reschedule.

Implementors§