0
$\begingroup$

Let's assume we are to implement a Round-Robin algorithm. What will happen in a case when a process has completed it's time quantum at the same time as another process arrives. Let's say we have a time quantum of 3 CPU cycles and a process A's burst time is 5 CPU cycles. If it runs from 0 to 3 (in CPU cycle time), and another process B also arrives at time 3 (in CPU cycle time), which process goes to the ready queue first? Is it possible for the process A to run 2 consecutive time quanta if the next process arrives at the same time as it completes it's first time quantum? This is one of those edge cases and it's very hard to find an explained example on the Internet. Thanks.

$\endgroup$
  • $\begingroup$ If two events happen at the exact same CPU tick, the higher priority interrupt wins. That's neither a question of scheduling nor one about computer science. It's all about hardware implementation and could be either way. $\endgroup$ – Rainer P. Nov 14 '17 at 19:11
  • $\begingroup$ Thanks. I suspected this was the case. However, one of the ways could be more efficient than the other and it could matter when I need to implement a simulation of the R-R algorithm. $\endgroup$ – Svyat L Nov 14 '17 at 22:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.