An RTOS gives embedded firmware the structure of tasks, priorities, queues and timers without the size of a general-purpose OS. “Real-time” means the scheduler guarantees that a high-priority task, such as reading a motor encoder or servicing a radio interrupt, runs within a bounded time regardless of what else is happening. FreeRTOS and Zephyr are the common choices in IoT.
The alternative is a bare-metal “super loop” that polls everything in sequence. That is simpler and fine for a sensor that wakes, reads, sends and sleeps, but it becomes fragile once a device has to keep a TLS connection alive, buffer data, run an update and respond to buttons at the same time. An RTOS costs some RAM and a learning curve, and it still needs a watchdog timer as a safety net.
Part of the IoT Glossary. Spotted an error or a missing term? Tell us.