The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+14 votes
1.5k views

Consider the following set of processes, with the arrival times and the CPU-burst times gives in milliseconds.

Process Arrival Time Burst Time
$P1$
$P2$
$P3$
$P4$
$0$
$1$
$2$
$4$
$5$
$3$
$3$
$1$

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 (59.7k points)
edited by | 1.5k views

2 Answers

+18 votes
Best answer

$0---P_1---1---P_2---4---P_4---5---P_3---8---P1---12$

Process       waiting time = (Turnaround time - Burst time ) turnaround time = ( Completion Time - Arrival Time ) 
$P1$ $7$ $12$
$P2$ $0$ $3$
$P3$ $3$ $6$
$P4$ $0$ $1$

Avg turnaround time $=12+3+6+1/4=22/4=5.5$

answered by Boss (31.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?
–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

43,942 questions
49,497 answers
162,339 comments
65,748 users