7 7 votes Consider three processes $P_1, P_2$, and $P_3$ arriving at time $t=0$ with burst times $10,5 ,$ and $8$ respectively. The scheduler uses Preemptive Shortest Remaining Time First (SRTF). A new process $P_4$ arrives at $t=3$ with a burst time of $2$.Calculate the average waiting time for all four processes (round off to $2$ decimal places). Operating System goclasses operating-system goclasses-cs-dpp goclasses-cs-dpp-day-202 goclasses-os-practice-questions numerical-answers + – GO Classes 272 views answer comment Share Follow Print 0 reply Please log in or register to add a comment.
3 3 votes At $t=0$ : Ready processes are $P_1(10), P_2(5), P_3(8)$. $P_2$ is the shortest.At $t=3: P_2$ has remained $5-3=2 . P_4$ arrives with $B T=2$. Since $P_2$ and $P_4$ have equal remaining time, $P_2$ continues (tie-breaker: same process).At $t=5: P_2$ finishes. Remaining: $P_4(2), P_3(8), P_1(10) . P_4$ runs next.At $t=7: P_4$ finishes. Remaining: $P_3(8), P_1(10)$. $P_3$ runs next.At $t=15: P_3$ finishes. $P_1$ runs last.At $t=25: P_1$ finishes. Wait Times $(W T=T A T-B T)$ :$P_1: 25-10=15$ $P_2: 5-5=0$ $P_3: 15-8=7$ $P_4:(7-3)-2=2$ Average $W T: \frac{15+0+7+2}{4}=\frac{24}{4}=6.00$ GO Classes answered Feb 21 GO Classes comment Share Follow 0 reply Please log in or register to add a comment.
0 0 votes Explanation Prashant-G answered Aug 1 Prashant-G comment Share Follow 0 reply Please log in or register to add a comment.
0 0 votes Caption sanjay_Malviya answered Aug 2 sanjay_Malviya comment Share Follow 0 reply Please log in or register to add a comment.