CREATE OWN LIBRARY

Q. (NET exam 2012 Dec, paper III) 

 

Consider 'n' process sharing the CPU in Round Robin fashion. Assuming that each process switch (context switching) time takes ’s’ second.  What must be the time quantum size 'q' such that the overhead resulting from process switching (context switching) is minimized, but at the same time each process is guaranteed to get its turn at the CPU at least every ’t’ seconds.

 

 

Answer:

 

Here every process in the ready queue obviously gets a chance to work with CPU a second time at least every t seconds. 

 

                         

Given,

Context switching time – s second & Time quantum size is q

 

Now, the main point is, every process (like P1) will chance to get the CPU a second time after t seconds.

 

Here the number of processes is n, now let n = 4 then 

 

[Number of context switching required = number of process]

 

[Number of time quantum required = number process -1] 

 

 

Option (a) is correct.