+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$
| 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:

+5 votes
7 answers
1
+5 votes
2 answers
2
+2 votes
2 answers
3
+3 votes
0 answers
4