Let's say there are two processes: p1 and p2, their arrival time and service time are 0,2 and 3,1 respectively. The time quantum is 2s.

After excuting for two seconds, will the processor excute p2 or continue excuting p1?


P1 arrives at time 0 and needs 3 seconds to process.

P2 arrived at time 2 and needs 1 second to process.


P1 arrives first and will process 2 second because time quantum is 2s. 1s left.

After processing P1 (2 seconds later), P2 will arrive.

It will completely process it and then return back to P1.

1 second later both processes are processed.

  • $\begingroup$ The service time of P1 is 3s, the time slice given is 2s, it is not completed after finishing the first time slice. $\endgroup$ – user762750 Oct 2 '19 at 17:04
  • $\begingroup$ Sorry, I updated my answer $\endgroup$ – Emrah Sariboz Oct 3 '19 at 3:05

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.