Unit content
Real-time operating systems
A real-time operating system (RTOS) provides multiple schedulable tasks and synchronization primitives while keeping timing behavior suitable for embedded control.
Each task has its own execution context and stack. A scheduler chooses which ready task runs, commonly using priorities so urgent work can preempt less urgent work.
Tasks can block while waiting for events instead of polling continuously. Queues, mutexes, event-signaling primitives and software timers provide structured ways to communicate and coordinate.
An interrupt handler often performs only time-critical hardware service, then wakes or signals a task that can perform longer processing at ordinary task level.
An RTOS adds overhead and more possible interleavings compared with a single superloop, but it can make a system with many independently timed activities easier to structure.
Using an RTOS does not automatically make a system real-time. Priorities, execution times, blocking and resource use must still be designed so the required deadlines can be met.