CPU Scheduling1
CPU Scheduling1
Basic Concepts
Maximum CPU utilization obtained with multiprogramming
CPU–I/O Burst Cycle – Process execution consists of a cycle
of CPU execution and I/O wait
CPU burst distribution
Alternating Sequence of CPU And I/O Bursts
Histogram of CPU-burst
Times
CPU Scheduler
P1 P2 P3
0 24 27 30
0 3 6 30
0 3 7 8 12 16
0 2 4 5 7 11 16
P1 P2 P3 P4 P1 P3 P4 P1 P3 P3
Three queues:
Q0 – RR with time quantum 8 milliseconds
Q1 – RR time quantum 16 milliseconds
Q2 – FCFS
Scheduling
A new job enters queue Q0 which is served FCFS. When
it gains CPU, job receives 8 milliseconds. If it does not
finish in 8 milliseconds, job is moved to queue Q1.
At Q1 job is again served FCFS and receives 16
additional milliseconds. If it still does not complete, it
is preempted and moved to queue Q2.
Multilevel Feedback
Queues
Multiple-Processor
Scheduling
CPU scheduling more complex when multiple
CPUs are available
Homogeneous processors within a multiprocessor
Load sharing
Asymmetric multiprocessing – only one processor
accesses the system data structures, alleviating
the need for data sharing
Real-Time Scheduling
Hard real-time systems – required to complete
a critical task within a guaranteed amount of
time
Soft real-time computing – requires that
critical processes receive priority over less
fortunate ones