Real-time operating systems

An RTOS adds tasks, priorities and predictable scheduling to a microcontroller, so deadlines can be met. Real-time means predictable timing, not raw speed.

Core

Pre-emptive scheduling of three tasks, and priority inversion A pre-emptive scheduler always runs the most important ready task: a high-priority task pre-empts a low one as soon as it is ready, and a medium task waits until the high one is done. In priority inversion, a high-priority task waits for a resource held by a low-priority task, and a medium task that pre-empts the holder makes the wait longer. A pre-emptive scheduler always runs the most important ready task High priority Medium priority Low priority pre-empts Low runs next Low resumes time becomes ready ready, waiting Priority inversion High priority Medium priority Low priority Low holds a shared resource waits for the resource Low holds finally runs pre-empts Low time Mutexes with priority inheritance limit this delay but do not remove it, so it also helps to share less.
A pre-emptive scheduler runs the most important ready task at once, except when a high-priority task must wait for a resource a lower-priority task holds.

Key points

  1. Real-time means meeting known deadlines: predictable timing, not raw speed. A pre-emptive scheduler always runs the most important task that is ready, so critical work does not wait behind less important tasks, except when they share a resource.12
  2. Widely used open-source RTOSes include FreeRTOS (MIT licence), Zephyr (Apache 2.0, a Linux Foundation project), Eclipse ThreadX (MIT licence), Apache NuttX (Apache 2.0) and RIOT (LGPL 2.1).34567as of 6 October 2026
  3. ThreadX, which Microsoft offered as part of its Azure RTOS suite, was contributed to the Eclipse Foundation in November 2023 and relicensed under MIT as Eclipse ThreadX, which remains actively released.58as of 6 October 2026
  4. Priority inversion happens when a high-priority task waits for a resource held by a lower-priority task, and gets worse if a medium-priority task interrupts the holder. Mutexes with priority inheritance limit the delay but do not remove it, so it also helps to share less.19

Sources

  1. Mastering the FreeRTOS Real Time Kernel (FreeRTOS Kernel Book) · FreeRTOS (AWS) · Project docs
  2. FreeRTOS: RTOS fundamentals · FreeRTOS (AWS) · Project docs
  3. FreeRTOS-Kernel LICENSE.md (MIT) · FreeRTOS (AWS) · Project docs
  4. Zephyr Project: learn about · Zephyr Project (Linux Foundation) · Project docs
  5. Eclipse ThreadX project page · Eclipse Foundation · Project docs
  6. Apache NuttX · Apache Software Foundation · Project docs
  7. RIOT OS · RIOT community · Project docs
  8. Introducing Eclipse ThreadX (21 November 2023) · Eclipse Foundation · News
  9. FreeRTOS: Mutexes · FreeRTOS (AWS) · Project docs