Chapter 5: CPU Scheduling
Chapter 5: CPU Scheduling
Basic Concepts
Scheduling Criteria
Scheduling Algorithms
Thread Scheduling
Multiple-Processor Scheduling
Objectives
To introduce CPU scheduling, which is the basis for
multiprogrammed operating systems
P1 P2 P3
0 24 27 30
Waiting time for P1 = 0; P2 = 24; P3 = 27
Average waiting time: (0 + 24 + 27)/3 = 17
FCFS Scheduling (Cont.)
P2 P3 P1
0 3 6 30
P4 P1 P3 P2
0 3 9 16 24
Average waiting time = (3 + 16 + 9 + 0) / 4 = 7
Determining Length of Next CPU Burst
P1 P2 P3 P1 P1 P1 P1 P1
0 4 7 10 14 18 22 26 30
Typically, higher average turnaround than SJF, but
better response
Time Quantum and Context Switch Time