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 |
Calculate the average response time for these processes with a nonpreemptive priority Scheduling algorithm? Priority of the process are as follows and consider that all the processes came at zero (0) time. (Note low numbers represent high priority).
Process | Arrival Time | Burst Time |
P1 | 5 | 3 |
P2 | 3 | 1 |
P3 | 2 | 5 |
P4 | 3 | 4 |
P5 | 1 | 2 |
Answer (Detailed Solution Below)
Option 1 : 5.6 ms
Detailed Solution
Download Solution PDFScheduling Algorithm: Non-preemptive Priority Scheduling (Low number = High Priority)
Gantt chart:
P5 |
P3 |
P2 |
P4 |
P1 |
0 2 7 8 12 15
Process Table:
Process |
Arrival Time (AT) |
Burst Time (BT) |
Completion Time (CT) |
Response Time (RT) |
P1 |
0 |
3 |
15 |
12 |
P2 |
0 |
1 |
8 |
6 |
P3 |
0 |
5 |
7 |
2 |
P4 |
0 |
4 |
12 |
8 |
P5 |
0 |
2 |
2 |
0 |
Average response time = \(\frac{{12 + 6 + 2 + 8 + 0}}{5} = 5.6\) ms
Answer: The correct option is 1) 5.6 ms.