The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+15 votes
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$
asked in Operating System by Veteran (52k points)
edited by | 1.8k views

2 Answers

+20 votes
Best answer

$$\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$

answered by Boss (30.9k points)
edited by
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$
–4 votes
5.750
answered by (3 points)
Answer:

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
49,576 questions
54,181 answers
187,499 comments
71,142 users