The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+11 votes
1.3k 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.4k points) | 1.3k views

2 Answers

+18 votes
Best answer

0---p1---1---p2---4---p4---5---p3---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.4k points)
edited by
0
How waiting time for p1 is 8?
–1
It should be 7.
0
Waiting Time for P1 should be 7. Please rectify it.
–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

35,487 questions
42,747 answers
121,459 comments
42,138 users