0 votes
in Cloud Computing by

What is the average waiting time for the following processes with preemptive SJF (Shortes Job First).

Process    Arrival Time        Burst Time

P1        0            8
P2        1            4
P3        2            9
P4        3            5

1.  6.5    2.  6.75     3.  7.5      4.  7.75

1 Answer

0 votes
by

Gantt Chart for preemptive SJF

P1

P2

P4

P1

P3

0                            1                             5                            10                            17                          26

The average waiting time for this example is ((10-1) + (1-1) + (17-2) + (5-3))/4 = 26/4 = 6.5
So, preemptive SJF is better than SJF.

Related questions

0 votes
asked May 30, 2020 in JAVA by Robindeniel
0 votes
asked Apr 23, 2022 in Statistics and Probability Basics by sharadyadav1986
...