Skip to main content

RoundRobinScheduler

Struct RoundRobinScheduler 

Source
pub struct RoundRobinScheduler { /* private fields */ }

Implementations§

Source§

impl RoundRobinScheduler

Source

pub fn new(time_slice: usize) -> RoundRobinScheduler

Source

pub fn add_process( &mut self, process: Box<ProcessControlBlock>, ) -> Result<(), &'static str>

Source

pub fn schedule(&mut self) -> Option<&mut ProcessControlBlock>

Source

pub fn yield_current(&mut self)

Source

pub fn tick(&mut self)

Source

pub fn current(&self) -> Option<&ProcessControlBlock>

Source

pub fn current_mut(&mut self) -> Option<&mut ProcessControlBlock>

Source

pub fn ready_count(&self) -> usize

Source

pub fn blocked_count(&self) -> usize

Source

pub fn zombie_count(&self) -> usize

Source

pub fn stats(&self) -> SchedulerStats

Source

pub fn is_idle(&self) -> bool

Source

pub fn find_zombie_child( &self, parent_pid: ProcessId, ) -> Option<(ProcessId, i32)>

Source

pub fn remove_zombie(&mut self, pid: ProcessId) -> bool

Source

pub fn has_living_children(&self, parent_pid: ProcessId) -> bool

Source

pub fn unblock_process(&mut self, pid: ProcessId) -> bool

Source

pub fn all_processes(&self) -> Vec<&ProcessControlBlock>

Source

pub fn block_current(&mut self)

Source

pub fn pick_next_ready(&mut self) -> Option<&ProcessControlBlock>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.