Skip to main content

TaskSet

Struct TaskSet 

Source
pub struct TaskSet {
    pub tasks: Vec<Task>,
}
Expand description

A task set for the static schedulability analysis.

Fields§

§tasks: Vec<Task>

The contained tasks.

Implementations§

Source§

impl TaskSet

Source

pub fn new() -> Self

Empty task set.

Source

pub fn push(&mut self, task: Task)

Adds a task.

Source

pub fn len(&self) -> usize

Number of tasks.

Source

pub fn is_empty(&self) -> bool

Whether the task set is empty.

Source

pub fn utilization(&self) -> f64

Total utilization U = Σ C_i/T_i.

Source

pub fn liu_layland_bound(n: usize) -> f64

The Liu & Layland utilization bound n·(2^(1/n) − 1) for n tasks.

Source

pub fn assign_rate_monotonic(&mut self)

Assigns rate-monotonic priorities: shorter period → higher priority. The priorities are assigned evenly across 0..=MAX in order (unique, as long as ≤ 32768 tasks).

Source

pub fn response_time(&self, i: usize) -> Option<u64>

Exact worst-case response time R_i of task i via fixed-point iteration. None if R_i exceeds the deadline (task not schedulable).

Source

pub fn response_times(&self) -> Vec<Option<u64>>

Response times of all tasks (index-parallel to tasks).

Source

pub fn is_schedulable_rta(&self) -> bool

Exact schedulability test (response-time analysis): all R_i ≤ D_i.

Source

pub fn is_schedulable_ll(&self) -> bool

Sufficient schedulability test (Liu & Layland): U ≤ n·(2^(1/n) − 1). Only meaningful for rate-monotonic with implicit deadlines; a false does not necessarily mean not-schedulable (use RTA in that case).

Trait Implementations§

Source§

impl Clone for TaskSet

Source§

fn clone(&self) -> TaskSet

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TaskSet

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TaskSet

Source§

fn default() -> TaskSet

Returns the “default value” for a type. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.