Académique Documents
Professionnel Documents
Culture Documents
Solution
A) You are required to provide the Gantt chart for non-preemptive SJF
(Shortest Job First) scheduling algorithm. Calculate the waiting time for
each process and average waiting time.
P1 P4 P3 P2
0 9 11 14 20
Processes Arrival time CPU Brust Completion time Turn around time Waiting time
P1 0 9 9 9 0
P2 3 6 20 17 11
P3 5 3 14 9 6
P4 6 2 11 5 3
= 20/4
b) You are required to provide the Gantt chart for preemptive SJF (Shortest
Job First) or STRF (Shortest Remaining Time First) scheduling algorithm.
Calculate the waiting time for each process and average waiting time.
Answer
P1 P3 P4 P1 P2
0 5 8 10 14 20
Visit www.infopalaces.blogspot.com
Processes Arrival time CPU Brust Completion time Turn around time Waiting time
P1 0 9 14 14 5
P2 3 6 20 17 11
P3 5 3 8 3 0
P4 6 2 10 4 2
= 18/4
Answer
From the above calculations it is proved that preemptive sjf is better in term
of avgerage waiting time
NOTE: IF YOU FOUND ANY MISTAKE THEN CORRECT IT PLEASE DON’T MAKE EXACT
COPY OF THIS SOLUTION, MAKE CHANGES TO AVOID ZERO MARKING. IM NOT
RESPONSIBLE FOR IT.
Visit www.infopalaces.blogspot.com
For others assignments solution please
visitwww.infopalaces.blogspot.com
Visit www.infopalaces.blogspot.com