Question
Download Solution PDFComprehension
Consider the following set of processes with the arrival time and length of CPU burst time given in milli secends (ms)
Process | Arrival Time | Burst Time |
P1 | 0 | 5 |
P2 | 2 | 3 |
P3 | 2 | 2 |
P4 | 5 | 3 |
P5 | 6 | 1 |
What is the average waiting time for these processes with non-preemptive Shortest Job First (SJF) scheduling Algorithm?
Answer (Detailed Solution Below)
Option 4 : 3.2 ms
Detailed Solution
Download Solution PDFScheduling Algorithm: Non-preemptive Shortest Job First (SJF)
Gantt chart:
P₁ |
P₃ |
P₅ |
P₂ |
P₄ |
0 5 7 8 11 14
Process Table:
Process |
Arrival Time (AT) |
Burst Time (BT) |
Completion Time (CT) |
Turn Around Time (TAT) |
Waiting Time (WT) |
P₁ |
0 |
5 |
5 |
5 |
0 |
P₃ |
2 |
2 |
7 |
5 |
3 |
P₅ |
6 |
1 |
8 |
2 |
1 |
P₂ |
2 |
3 |
11 |
9 |
6 |
P₄ |
5 |
3 |
14 |
9 |
6 |
Average waiting time = \(\frac{{0 + 3 + 1 + 6 + 6}}{5} = 3.2\)
Important Points:
WT = TAT - BT