The Gateway to Computer Science Excellence
+6 votes
2.7k views

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

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

What is the sequence in which the processes are completed? Assume round robin scheduling with a time quantum of $2$ milliseconds.

  1. $P1, P2, P3$
  2. $P2, P1, P3$
  3. $P3, P2, P1$
  4. $P2, P3, P1$
in Operating System by Boss (30.8k points) | 2.7k views

2 Answers

+13 votes
Best answer
0-2 2-4 4-6 6-7
p1 p2 p1 p3

answer B)- P2, P1, P3

by (301 points)
selected by
0
answer is d
0
Why was P3 not picked in 4-6 slot ?
0
Same question why p3 is not picked in 4-6 slot?
0
how b will come? i think d is correct..plz explain
+1
After time Quantum duration 2, as P1 Quantum finished at 2 so it again came in line to process in next cycle.And P3 Arrival time is 3 so it will come after P1. once P2 finished at 4. P1 will Start Processing.
that why P3 will not picked in 4-6 slot.
+2 votes
0----------P1----------2----------P2----------------4-------------P3-----------5----------------P1----------------7

Answer D)
by Veteran (119k points)
+11
I think You are not looking at the arrival time of p3 .... so acc. to me after 2 ms p2 is staring and p1 is getting scheduled in ready queue and at 3ms p3 arrives so it will be scheduled in ready queue after q1 and then at 4ms p2 is over and p1 gets CPU and then at 6ms p1 is over and p3 gets CPU.

p2--p1--p3
So ans should be option B.
0
ok u mean after 2 ms when P2 starts then P1 will come in ready queue again

 P3 comes in 3 ms

So, P1 will execute before P3
+1
@srestha yes :)
+7
when in doubt think of an implementation where we need to have a queue of processes and new one goes to the end of queue.
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
50,737 questions
57,324 answers
198,404 comments
105,169 users