IT lexicon › Programming › Task states (RTOS)

Task states (RTOS)

Programming På svenska → Updated: 2026-11-04

The handful of conditions a task in a real-time OS can be in — and the only question the scheduler really asks: who is runnable?

FreeRTOS's names are typical. Running is the one task that currently owns the CPU. Ready tasks are runnable and waiting their turn, sorted by priority. Blocked tasks are waiting for something — a semaphore, a queue, a delay — usually with a timeout. Suspended tasks have been explicitly parked with vTaskSuspend() and wake only on an equally explicit call.

That makes the scheduler's job almost trivial: run the highest-priority task in Ready. Most of an RTOS's complexity lives in the transitions. An interrupt handler that gives a semaphore moves a task from Blocked to Ready, and if that task outranks the current one a context switch happens before the interrupt has even returned. When every task is Blocked the idle task runs, which in a well-built system is the most common state of all.

← Back to the lexicon