Escolar Documentos
Profissional Documentos
Cultura Documentos
CPU
Scheduling
(Chap-6)
Scheduling Criteria
Scheduling Algorithms
First-Come-First-Serve (FCFS) Scheduling
Shortest Job First (SJF) Scheduling
Priority Scheduling
Round-Robin (RR) Scheduling
Multilevel Queue Scheduling
Multilevel Feedback Queue Scheduling
P1 24
P2 3
P3 3
Suppose that the processes arrive in the order: P1 , P2 , P3
The Gantt Chart for the schedule is:
P1 P2 P3
0 24 27 30
P2 P3 P1
0 3 6 30
P1 0.0 7
P2 2.0 4
P3 4.0 1
P4 5.0 4
SJF (non-preemptive)
P1 P3 P2 P4
0 3 7 8 12 16
P1 0.0 7
P2 2.0 4
P3 4.0 1
P4 5.0 4
SJF (preemptive)
P1 P2 P3 P2 P4 P1
0 2 4 5 7 11 16
P1 30
P2 6
P3 8
The Gantt chart is:
P1 P2 P3 P1 P2 P3 P1 P1 P1 P1
0 5 10 15 20 21 24 29 34 39 44
three queues:
Q0 – time quantum 8 milliseconds
Q1 – time quantum 16 milliseconds
Q2 – FCFS
Scheduling:
The scheduler first executes all processes in Q0. Only when
Q0 will empty, it will executes the processes in Q1.
Similarly, processes in Q2 will be executed only if Q0 and Q1
are empty.
A process that arrives for Q1 will preempt a process in Q2.
A process that arrives for Q0 will preempt a process in Q1.
following parameters:
number of queues
scheduling algorithms for each queue
method used to determine when to upgrade a process
method used to determine when to demote a process
method used to determine which queue a process will
enter when that process needs service.
From the properties and definition of a multilevel
feedback queue scheduler makes it the most general
CPU-scheduling algorithm, but it also the most complex.
It can be configured to match a specific system under
design.
Thank You
Operating System Concept Ashish Kumar Dass
6.26