IT lexicon › Programming › Idle task

Idle task

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

The lowest-priority task in an RTOS, which runs when nobody else has anything to do — because the processor always has to run something.

The scheduler needs an answer to "what now?" even when every task is waiting on a queue, a timer or an interrupt. FreeRTOS therefore creates an idle task automatically when the scheduler starts. It has a few chores, such as freeing the stack and control block of tasks that deleted themselves, and it must never block: if it did, there would be nothing left to run.

The practical value is in the hook. Through an idle hook the application can put the processor to sleep with WFI — the first step towards tickless idle — or measure CPU load as the share of time spent idling. An idle task that never gets to run is a reliable sign that some high-priority task is spinning in a loop instead of waiting, and that any deleted tasks are never being cleaned up either.

← Back to the lexicon