11,250 views
6 votes
6 votes

         
     Measurements  of a certain  system  have shown that a process  runs, on the
     average,  for time T  before  blocking  for  Input/Output.  Process  switch
     requires time S which is overhead.  For round robin scheduling with quantum
     Q, give a formula for the cpu efficiency in each of the following cases:

     (a) Q=infinity  (b) Q>T  (c) S<Q<T  (d) Q=S  (e)  Q nearly 0
          
      Answer:
      
      
     cpu efficiency is useful cpu time/total cpu time, i.e.  sum of cpu
     useful time and cpu overhead in switching processes.

     For (a) and (b) a  process  runs  for T and a  switch  occurs  when it gets
     blocked.  Efficiency is T/(T+S)

     In (c), since Q<T, each run of T requires T/Q process  switches,  resulting
     in overhead of ST/Q and therefore, the efficiency is T/(T+(ST/Q))  which is
     Q/(Q+S).

     For (d), take Q for S in (c) and we get Q/(Q+Q) which is 50%
     
     For (e), the efficiency goes to 0 as Q goes to 0

Can somebody please explain option c and hence option D with example ,Thanks and sorry if it is naive question :)

1 Answer

Best answer
4 votes
4 votes

There is one more solution to this question:

 Assume T is the total processing time and S is the overhead for each 
     content switch. Then the CPU efficiency can be represented by the 
     equation: T / ([T/Q] - 1) * S + T 
               where [T/Q] = k is an integer and k >= T/Q and k < T/Q + 1.

     (a) Q = infinity. It becomes T / T = 1

     (b) Q > T. It becomes T / T = 1

     (c) S < Q < T. The efficieny is T / ([T/Q] - 1) * S + T. 

     (d) Q = S. 

         If T > Q,
         T / (T/Q * S - S) + T = T / (T - S) + T = T / 2T - S = T / 2T - Q.
         If T < Q, it becomes T / T = 1.

     (e) Q is nearly zero. It becomes T / infinity = 0.

Let us solve option c first:

 

here the closer the value of Q is from T then more the efficiency 

In option d if the value of T < S then the efficiency is 100% 

selected by

Related questions

8 votes
8 votes
6 answers
2
1 votes
1 votes
1 answer
3
sanyam53 asked Jan 7, 2017
1,653 views
How many time context switch in Round Robin? ( if only one process remain in ready queue at end of scheduling does that count every time, when time slice over or only one...