Consider the following process with respective arrival time and burst time:
Process Id |
Arrival Time |
Burst Time |
P1 |
0 |
7 |
P2 |
3 |
5 |
P3 |
7 |
11 |
P4 |
4 |
8 |
What will be the throughput when the highest response ratio next(HRRN) scheduling algorithm is applied.
(A) 10.81
(B) 12.90
(C) 13.50
(D) None of these.
Answer: (B)
Explanation: Using HRRN algorithm:
There is only one process at P1 0 it will be scheduled into CPU.
Now at 7 unit of time, two more processes are available i.e. P2 and P3. To schedule these processes response ratio needed
Response ratio = (waiting time + burst time) / burst time
Waiting time for P2 = 7 – 3 = 4.
Response ratio for P2 = (4 + 5) / 5 = 1.8
Waiting time for P3 = 7 – 7 = 0
Response ratio for P3 = (0 + 11) / 11 = 1
Waiting time for P4 = 7 – 4 = 3
Response ratio for P4 = (3 +8) / 8 = 11 / 8
Higher response ratio process will be scheduled first
Now calculate response ratio again
Waiting time for P3 = 12 – 7 = 5
Response ratio for P3 = (5 + 11) / 11 = 16 / 11
Waiting time for P4 = 12 – 4 = 8
Response ratio for P4 = (8 + 8)/ 8 = 2
Now P4 have higher response ratio and it will scheduled into CPU
Now Only P3 remains to be scheduled into CPU. So, Next process is P3 to be scheduled
Throughput = number of processes / (Max completion time – min arrival time) *100
= 4 / (31 – 0) * 100 = 12.9
So, option (B) is correct.
Quiz of this Question
Share your thoughts in the comments
Please Login to comment...