Scheduling
Scheduling
Scheduling
CPU SCHEDULER
Selects from among the processes in memory that are ready to
execute, and allocates the CPU to one of them
0 24 27 30
P2 P3 P1
0 3 6 30
0 3 9 16 24
0 4 7 10 14 18 22 26 30
MULTILEVEL QUEUE
• Ready queue is partitioned into separate queues:
foreground
background
• Each queue has its own scheduling algorithm
• foreground – RR
• background – FCFS
• Scheduling must be done between the queues
• Fixed priority scheduling; (i.e., serve all from foreground then from
background).
• Time slice – each queue gets a certain amount of CPU time which it
can schedule amongst its processes; i.e., 80% to foreground in RR
• 20% to background in FCFS
EXAMPLE OF MULTILEVEL FEEDBACK QUEUE
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
END OF LECTURE