1,534 views
0 votes
0 votes

In case of Round robin algorithm with time quantum = 2s, and process P1 starting at t=0 and have processes P2, P3 in queue

If a process P4  arrives at  t =2s, but at the same time t=2s, P1 which was executing is preempted  since the quantum expires.

Which process will be put ahead whether P1 ahead of P4 or P4 ahead of P1 ? 

I mean the waiting queue will have the order P2, P3, P4, P1 or P2, P3, P1, P4 because there is race between P4 and P1.

2 Answers

2 votes
2 votes

In case of ROUND ROBIN ...things are like ...

If any process is preempted and at the same time if a new process arrives then we should follow this .

"ADD FIRSTLY ALL INCOMING PROCESS IN QUEUE THEN AT LAST ADD THE ONE WHICH WAS PREEMPTED.."

Like P1 , P2  , P3 is there if P1 preempted at 2s and P4 also comes at  sec ...then in QUEUE ADD p4 First then P1 always ..

Related questions

0 votes
0 votes
3 answers
1
0 votes
0 votes
0 answers
4
lolalo asked Aug 4, 2022
413 views
https://gateoverflow.in/1690/gate-cse-1998-question-2-17-ugcnet-dec2012-iii-43in the question in the above link, why the answer is A but not B?The question says at least ...