edited by
2,879 views
2 votes
2 votes
in a round robin scheduling s represents the time of context switching, q represents the time quantum and r represents the average time the process runs before blocking on i/o.

if s<q<r, then cpu efficiency?

a )q/q+s

b) q/r+s

c) r/r+s

d) qr/r+s
edited by

4 Answers

3 votes
3 votes
let assume that the processes takes n quantums so in normal scheduling it will be Nq

now in the rr scheduling it will be N(q+s).....

so the efficiency will be Nq/(N(q+s))=q/q+s

 

option a
2 votes
2 votes
The process needs to spend 'r' units of time in CPU. But since this is a question of round robin scheduling, it has to switch between run and ready state after spending every 'q' units in CPU. Suppose it has do 'n' switches. So in order to complete 'r' units, r=nq gives n=(r/q) no. of switches.

Now, after every 'q' comes the time spent on context switching which is 's'. So n*s times wasted for this purpose.

Time utilized in CPU is 'r' (or nq, its the same thing).

Total time needed for this process to complete is r+ns (or you can write n(q+s) ).

CPU utilization is = r/(r+ns)

Replace n with r/q and you will get Option A.
0 votes
0 votes
i think answer should be (c)

as r will include quantum time also because watever time process will execute it will be quantum time only
0 votes
0 votes
Answer is A because, for every useful time $q$ spent by CPU, it is spending $q+s$ time in total, ie in total q+s time units CPU is doing useful work for only q time units. therefore efficiency is $q/q+s$. Same concept as of networks.

Related questions

1.5k
views
1 answers
0 votes
anupamsworld asked Jun 6, 2022
1,478 views
Lets consider one situation where,OS is scheduling processes(P1,P2,P3...Pn) with Round Robin method and current running process is P1 and next scheduled process in queue ...
628
views
2 answers
1 votes
Tuhin Dutta asked Oct 8, 2017
628 views
I encountered 1 question on context switching in Made Easy test series where it is mentioned:Scheduling policy is preemptive priority. Context switch time is 1 unit.So wh...
437
views
1 answers
1 votes
iarnav asked Jan 12, 2022
437 views
Does non preemptive CPU scheduling needs hardware support.kindly explain.
11.6k
views
1 answers
6 votes
sunil sarode asked Nov 15, 2017
11,573 views
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 t...