Real-time operating system (RTOS)
An RTOS is a tiny operating system for embedded devices whose defining promise is not speed but punctuality: it guarantees that an urgent task will run within a known, bounded deadline, every single time. The word 'real-time' is about timing guarantees, not raw performance — a system that's blisteringly fast on average but occasionally late is not real-time, while a slower one that never misses its deadline is. Think of an airbag controller: firing 5 milliseconds late is as useless as never firing. The RTOS exists to make 'on time, always' a hard contract.
It works by splitting your program into independent tasks, each with a priority, and a scheduler that always runs the highest-priority ready task — pre-empting a lower one mid-execution the instant something more urgent wakes up. It hands you the toolkit for juggling many things at once: tasks, queues to pass data between them, semaphores and mutexes to share resources safely, and a steady tick interrupt to drive timing. FreeRTOS, Zephyr, and ThreadX run on chips with just kilobytes of RAM. The cost is care: priority inversion, race conditions, and deadlocks are real hazards, so 'hard' real-time systems (avionics, ABS brakes, pacemakers) demand rigorous analysis to prove every deadline can be met.
Hard vs soft real-time: in a hard real-time system a missed deadline is a system failure (an airbag, a flight controller); in a soft one it just degrades quality (a video frame dropped, audio stutters). 'Real-time' never means 'fast' — it means 'predictably on time'.