Scheduling

Real example---Linux

Essentially Linux has two queues (as in multilevel scheduling), one for real-time processes, one for regular processes.

Each process has a priority. Priority determines how many jiffies it gets in its quantum (jiffy size determined by system clock). Each process maintains a counter which determines how many jiffies it has left. The task with highest counter gets the processor. For example, if a high-priority task uses up half its jiffies, then blocks, it might not run when it becomes unblocked again, since another task may have more jiffies left, and its counter may be higher. This scheme guarantees that all processes get a go eventually (even if only briefly). Linux uses a round-robin scheme for equal-priority processes.

Real-time processes can run either round-robin mode, as with regular tasks, or in first-come-first-served mode (if performing small, fast, important task.)

Scheduler gives absolute priority to real-time tasks over regular tasks => must be careful which processes run in 'real time' mode.

Thus Linux uses several of the techniques we have just mentioned: fcfs, rr, priority & multilevel (& allows for soft real time tasks).


last updated 29 April 1998