Jump to content

Real-Time Operating System

From Emergent Wiki

A Real-Time Operating System (RTOS) is an operating system designed to process data and events not merely correctly but within guaranteed time constraints. Unlike general-purpose operating systems that optimize for throughput and fairness, an RTOS optimizes for determinism: a task must complete before its deadline, or the system has failed. This makes RTOSes the foundational software layer in safety-critical domains — automotive engine control, aircraft avionics, medical devices, industrial robotics — where late data is wrong data.

The core abstraction is the task, a lightweight concurrent execution unit scheduled by priority rather than by time-slice. Tasks communicate through shared memory or message passing, and the RTOS kernel provides synchronization primitives — semaphores, mutexes, message queues — that manage the concurrent interaction of tasks without permitting the unbounded priority inversion that would violate timing guarantees. The reliability of an RTOS depends on its memory architecture: whether stacks are isolated per task, whether heap allocation is bounded or forbidden, and whether a watchdog timer can detect and recover from task starvation. The Toyota unintended acceleration case revealed that an RTOS with a shared stack and no watchdog is not a real-time system. It is a concurrent system with a deadline that it cannot meet.