4CPU Scheduling
4CPU Scheduling
0 24 27 30
0 3 6 30
0 3 7 8 12 16
0 2 4 5 7 11 16
Draw Gantt chat and find the average waiting time in each
of the following cases:
SRTF Scheduling
SJN Scheduling
FCFS Scheduling
Dr. Manmath N. Sahoo (CS) 13
Answer to Example Process Arrival Time Burst Time
P1 0 16
P2 2 8
P3 4 12
P4 6 2
P5 8 4
SRTF
P1 P2 P2 P4 P2 P5 P3 P1
0 2 4 6 8 12 16 28 42
FCFS + Preemption = RR
Performance
q large behaves similar to FCFS
q small more context switch overhead
P1 P2 P3 P5 P4
0 3 9 13 15 20
Objectives:
to optimize turnaround time.
To minimize response time (to make a system feel
responsive to interactive users).
THE CRUX:
• Rule 5: After some time period S, move all the jobs in the system to
the topmost queue.
(a) Without Priority Boost (b) With Priority Boost in every 50ms
P1 P2 P3 P5 P4
0 3 9 13 15 20
RR Scheduling on 04 CPUs:
processes bounce from CPU to CPU.
Solution – SQMS must adopt some affinity mechanism (requires
migration)
• A finishes