I need help with this. Round robin: a special case as two processed one used up it time quantum and the other arrives at the same time. For example, we has the following processes:
Process P1: + Arrival time: 0 + Burst time: 7 Process P2: + Arrival time: 5 + Burst time: 7 Assuming that time quantum q = 5 and after time quantum ending if a process doesn't complete it is added to at the end of the queue.
My confusion is about at the time 5. At this time, time quantum of P1 expires and P2 also arrives. What should come the queue first?
i think this question is similar to yours and the answer will be helpful
Special case scheduling
in short
The reason for this,as given in the above link ,is that the OS prefers P1 since it was recently running and hence it can avoid an unnecessary context switch i.e
p1->p1->p2->p2is better thanp1->p2->p1->p2