Crate scheduler_epoch

source ·
Expand description

This crate implements a token-based epoch scheduling policy.

At the begining of each scheduling epoch, a set of tokens is distributed among all runnable tasks, based on their priority relative to all other runnable tasks in the runqueue. The formula for this is:

tokens_assigned_to_task_i = (priority_task_i / sum_priority_all_tasks) * epoch_length;
  • Each time a task is picked, its token count is decremented by 1.
  • A task can only be selected for next execution if it has tokens remaining.
  • When all tokens of all runnable task are exhausted, a new scheduling epoch begins.

This epoch scheduler is also a priority-based scheduler, so it allows getting and setting the priorities of each task.

Structs

  • An instance of an epoch scheduler, typically one per CPU.