Search code examples
scheduled-tasksround-robin

order of Processes in this special case of round robin scheduling


(this was a question asked in the 5th semester of my computer engineering degree)

What will the order of process execution be in the following scenario, given that the scheduling used is Round Robin?

QUANTUM SIZE = 4

Process----Arrival time----Burst time

A---0---3

B---1---5

C---3---2

D---9---5

E---12---5

My real doubt comes at time 9. At this point, A and C have finished execution. B is in the queue and D has just entered. Which one will be executed first? B or D?

should the overall order be A-B-C-D-E-B-D-E or A-B-C-B-D-E-D-E?


Solution

  • In round robin processes are executed for a time period called Quantum you haven't mentioned it. Still there is no problem. Round Robin algorithm says that each process will get equal time period for execution in a circular fashion. At the point of ambiguity, it implements First Come First Serve method. You are mentioning a deadlock situation here. B should com first. Here are few references: Word Definition a simple example