1.8k views

Consider the following set of processes, with the arrival times and the CPU-burst times gives in milliseconds.
$$\begin{array}{|c|c|c|} \hline \textbf{Process} & \textbf{Arrival Time} & \textbf{Burst Time}\\\hline \text{P1} & 0 & 5\\ \text{P2} & 1 & 3\\ \text{P3} & 2 & 3 \\ \text{P4} & 4 & 1\\\hline \end{array}$$

What is the average turnaround time for these processes with the preemptive shortest remaining processing time first (SRPT) algorithm?

1. $5.50$
2. $5.75$
3. $6.00$
4. $6.25$
edited | 1.8k views $$\begin{array}{|c|c|c|} \hline \textbf{Process} & \textbf{Waiting Time = } & \textbf{Turnaround Time =} \\ & \textbf{(Turnaround Time - Burst time)} & \textbf{(Completion Time - Arrival Time )}\\\hline \text{P1} & 7 & 12 \\\hline \text{P3} & 0 & 3\\\hline \text{P2} & 3 & 6 \\\hline \text{P4} & 0 & 1\\\hline \end{array}$$
Average turnaround time $=12+3+6+1/4=22/4=5.5$

Correct Answer: $A$

edited
0
How waiting time for p1 is 8?
0
It should be 7.
0
Waiting Time for P1 should be 7. Please rectify it.
0
It is because the BT for P1 is 5, TAT is 12 and WT = TAT-BT so that's why WT is 7.
0
how p3 tat is 6?
0
$TAT=CT-AT$

for $P_{3}:$

$TAT=8-2=6$