What the heck is an RTOS?

Generally speaking, a general-purpose OS like Windows is focused on the management of the hardware resources of a computer, and managing the application which run on the computer, while providing a smooth and accessible user interface for computer users to interact with.

While an RTOS has to manage CPU hardware and such as well, the primary development focus is on running applications with a high degree of reliability, and extremely precise timing. 

RTOS must be able to guarantee a maximum amount of time for its most critical processes, including OS calls and interrupt handling. There are two main categories here: “hard real-time” where the OS is able to guarantee maximum process time all of the time; and “soft real-time” where the OS is able to guarantee maximum process times most of the time, but not necessarily always. There are differing use cases for these categories depending on the sensitivity of the system being designed. If developed correctly, RTOS allows for extremely precise process control by giving developers a great deal of control over the prioritization of tasks.

In addition to hard vs soft real-time, there are a couple of other important concepts in RTOS development, such as:

Determinism: An application (or critical section of an application) is considered deterministic if its timing can be guaranteed within a certain margin of error.

Jitter: The amount of error in the timing of a task over subsequent iterations of a program or loop is referred to as jitter. When RTOS are developed well and fully optimized, they provide very little jitter, and what is present can be predicted and appropriately considered in scheduling and prioritization.

There are a couple of general classes of RTOS application, referred to as “event-response” and “closed loop.” Event response systems are used in cases which require a response to some external stimuli within a predictable amount of time, such as automated visual inspection of manufactured parts in high-precision manufacturing facilities. Closed loop systems continuously receive and respond to an ongoing feed of data, such as an automotive cruise control system.

RTOS are best-suited for use cases which require extended runtime without interruptions in service and are often intended for uninterrupted 24/7 operations. In cases where downtime is unacceptable, like airline flight control systems, self-driving vehicles, and precision manufacturing, RTOS provide reliability, predictability, and performance optimized for these sorts of workloads. 

Leave a comment