Question
Download Solution PDFGiven the following processes with their times and priority (lower number indicates higher priority)
Process | Burst Time | Priority |
P1 | 10 | 3 |
P2 | 1 | 1 |
P3 | 2 | 4 |
P4 | 1 | 5 |
P5 | 8 | 2 |
Which of the following is a value of average waiting time using priority scheduling algorithm?
Answer (Detailed Solution Below)
Detailed Solution
Download Solution PDFConcept:
In Priority Scheduling (Non-Preemptive), the process with the highest priority (i.e., lowest numerical value) is scheduled first. If two processes have the same priority, FCFS (First-Come-First-Serve) is used.
FORMULAE:
TAT = CT − AT
WT = TAT − BT
AT (Arrival Time) is assumed to be 0 for all processes in this question.
Analysis:
GANTT CHART: P₂ → P₅ → P₁ → P₃ → P₄
Pid |
BT |
Priority |
CT |
TAT |
WT |
P₂ |
1 |
1 |
1 |
1 |
0 |
P₅ |
8 |
2 |
9 |
9 |
1 |
P₁ |
10 |
3 |
19 |
19 |
9 |
P₃ |
2 |
4 |
21 |
21 |
19 |
P₄ |
1 |
5 |
22 |
22 |
21 |
Average Waiting Time =\(\frac{0 + 1 + 9 + 19 + 21}{5} = \frac{50}{5} = 10.0\)
Hence, the correct answer is: option 4. The accurate average waiting time is 10.0 units.