CPU Scheduling - OS
CPU Scheduling - OS
CPU Scheduling - OS
OBJECTIVES
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 followed by
I/O burst
CPU burst distribution
is of main concern
HISTOGRAM OF CPU-BURST TIMES
CPU SCHEDULER
P1 P2 P3
0 24 27 30
P2 P3 P1
0 3 6 30
P1 P2 P4 P1 P3
0 1 5 10 17 26
P1 P2 P3 P1 P1 P1 P1 P1
0 4 7 10 14 18 22 26 30
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