Idle

From COMP15212 Wiki
Revision as of 09:02, 25 June 2019 by pc>Yuron
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Depends on Process StatesProcess Scheduling

In a simple, single-tasking system, when the processor cannot do useful work it will simply ‘busy-wait’ until some stimulus (in the one job it’s currently doing) occurs.

In a multitasking system system it is usual to block the process and schedule something else.

What if there are no tasks in the ready state? The processor cannot (permanently) ‘halt’ because something is liable to want to run again in future.

It is normal to provide some sort of “idle” task, which busily does nothing except wait until a ‘real’ process becomes ready. In modern processors there is often a ‘SLEEP’ type instruction which puts the processor into a low-power mode until (for example) an interrupt is requested, since only an external event is going to cause a change in processor state.

The idle process will probably have to be a bit ‘special’, depending on the scheduling algorithm.

  • In a real-time system (where, by definition, all other processes will block on occasion) it may be sufficient to simply run idle continuously at a uniquely low priority.
  • In an interactive system it is undesirable for idle to have regularly scheduled time-slices as this can detract from the time available for useful processing.

The idle process may be a bit smarter than purely ‘do nothing’; for example it could note the times it starts and stops for ‘accounting’ purposes. (You may be able to find this in (e.g.) the Unix top utility.)



Articles on Processes
About this resource • Atomicity • Containers • Context • Context Switching • Daemons • Fork Unix • Hypervisor • Idle • Interprocess Communication • Multi Threading • Mutual exclusion • Pipes • Pointer Arithmetic • Process Control Block (PCB) • Process Priority • Process Scheduling • Process States • Processes • Queues • Queues Extra • Race Conditions • Real Time • Resources • Scheduler • Signal and Wait • Sleep • Starvation • Synchronisation • Thrashing • Threads • Unix Signals