Skip to main content

Crate axtask

Crate axtask 

Source
Expand description

ArceOS task management module.

This module provides primitives for task management, including task creation, scheduling, sleeping, termination, etc. The scheduler algorithm is configurable by cargo features.

§Cargo Features

  • multitask: Enable multi-task support. If it’s enabled, complex task management and scheduling is used, as well as more task-related APIs. Otherwise, only a few APIs with naive implementation is available.
  • irq: Interrupts are enabled. If this feature is enabled, timer-based APIs can be used, such as sleep, sleep_until, and [WaitQueue::wait_timeout].
  • preempt: Enable preemptive scheduling.
  • sched-fifo: Use the FIFO cooperative scheduler. It also enables the multitask feature if it is enabled. This feature is enabled by default, and it can be overriden by other scheduler features.
  • sched-rr: Use the Round-robin preemptive scheduler. It also enables the multitask and preempt features if it is enabled.
  • sched-cfs: Use the Completely Fair Scheduler. It also enables the the multitask and preempt features if it is enabled.

Functions§

sleep
For single-task situation, we just busy wait for the given duration.
sleep_until
For single-task situation, we just busy wait until reaching the given deadline.
yield_now
For single-task situation, we just relax the CPU and wait for incoming interrupts.