Applied Operating Systems
Topics based on Chapter 6
CPU Scheduling


Topics covered

Short-term Scheduling
Short-term Scheduling Algorithms
Why does Scheduling Work?
CPU-burst times histogram
(Figure 6.2)

CPU Scheduler

Dispatcher
Possible scheduling criteria
Scheduling criteria
First-Come, First-Served Scheduling (FCFS)
First process needing CPU gets it allocated (FIFO queue)
Nonpreemptive

Example: p1 (burst time 24); p2 (3); p3 (3)/arrive at t=0 in order

See Gant chart on p. 141
average turnaround time = (24+27+30)/3 = 27
average wait time = (0+24+27)/3 = 17
 

First-Come, First-Served Scheduling (FCFS)
Example: p1 (burst time 4); p2 (3); p3 (15)/arrive at t=0
See Gant chart on p. 142
average turnaround time = (24+27+30)/3 = 11
average wait time = (0+24+27)/3 = 3.67
First-Come, First-Served Scheduling (FCFS)
What happens if we reverse the order of arrival?
Example: p3 (burst time 15); p2 (3); p1 (4)/arrive at t=0
Constructing the Gantt chart is left as an exercise for the student.
FCFS Scheduling
Shortest Job First Scheduling (SJF)
Shortest Remaining Time First
SJF/SRTF
(compare Gantt chart on page 143 with that on page 145)

SJF Scheduling

Predicting the length of the next CPU burst
tn+1 = a tn + ( 1 - a) tn
Exponential averaging
tn+1 = a tn + ( 1 - a) tn
Exponential averaging
tn+1 = a tn + ( 1 - a) tn
tn+1 = a tn + ( 1 - a) a tn-1 + Ö + ( 1 - a)^ja tn-j + Ö
+ ( 1 - a)^(n+1)a t0
Priority Scheduling
(a general concept)
Priority Scheduling
Round Robin Scheduling
(preemptive)
Round Robin Scheduling
Round Robin Scheduling
Round Robin Scheduling
Quantum Size
Multilevel Queue Scheduling
Multilevel Queue Scheduling
Multilevel Feedback Queue Scheduling (MLF)
Multilevel Feedback Queue Scheduling (MLF)
MLF Scheduling
Example two
Special situations:
Multiple processor scheduling
Special situations:
Real-time scheduling
Algorithm Evaluation
VAX/VMS OS Scheduling
(a more complex example)
VAX/VMS Scheduling
(a real-world example)
VAX/VMS Scheduling
VAX/VMS Scheduling