Crate scheduler

source ·
Expand description

Offers the ability to control or configure the active task scheduling policy.

What is and isn’t in this crate?

This crate also defines the timer interrupt handler used for preemptive task switching on each CPU. In init(), it registers that handler with the [interrupts] subsystem.

The actual task switching logic is implemented in the [task] crate. This crate re-exports that main schedule() function for convenience, legacy compatbility, and to act as an easy landing page for code search. That means that a caller need only depend on [task], not this crate, to invoke the scheduler (yield the CPU) to switch to another task.

Functions

  • Re-exports for convenience and legacy compatibility. Modifies the given task’s priority to be the maximum of its priority and the current task’s priority.
  • Initializes the scheduler on this system using the policy set at compiler time.
  • Re-exports for convenience and legacy compatibility. Returns the priority of the given task.
  • Re-exports for convenience and legacy compatibility. Yields the current CPU by selecting a new Task to run next, and then switches to that new Task.
  • Re-exports for convenience and legacy compatibility. Sets the priority of the given task.