1,926 views
1 votes
1 votes

Measurements of a certain system have shown that the average process runs for a time $T$ before blocking on $I/O$. A process switch requires a time $S$, which is effectively wasted (overhead). For round-robin scheduling with quantum $Q$, give a formula for the CPU efficiency for each of the following:

  1. $Q = \infty$
  2. $Q > T$
  3. $S < Q < T $
  4. $Q = S$
  5. $Q\: \text{nearly}\: 0$

1 Answer

1 votes
1 votes

Answer:

CPU efficiency =$ \frac{\text{useful CPU time}}{ \text{total CPU time}}$

(a) and (b):

The process is executed for time $\textbf T$ and a switch happens when it is blocked.

$\therefore \text {Efficiency} = \dfrac{\textbf T }{\textbf T + \textbf S}$

So, when $\textbf {S = 0}, \text{CPU Efficiency} = \dfrac{\textbf T}{\textbf T} = 100\%$

(c):

 $\because \textbf Q<\textbf T$, for each run of $\textbf T$ needs $\dfrac{\textbf T}{\textbf Q}$  process switches, which results in overhead of $\dfrac{\textbf {ST}}{\text Q}$

$\therefore \text {Efficiency }=\dfrac{\textbf T}{\textbf T+\dfrac{\textbf {ST}}{\textbf Q}} = \dfrac{\textbf Q}{\textbf Q + \textbf S}$

So, CPU Efficiency varies from $100\%$ to $50\%$ depending on $\textbf {TQ}$

(d):

Substitute $\textbf Q$ for $\textbf S$ in $\text {(c)}$, and we get $\frac{\textbf Q}{\textbf Q+\textbf Q }= 50%$

So, Efficiency $=50\%$

(e):

$\text{The Efficiency} \to 0\; \text {as} \;\textbf Q \to 0$

So, Efficiency$\approx \textbf0\%$

 

edited by

Related questions

0 votes
0 votes
1 answer
1
0 votes
0 votes
1 answer
3
admin asked Oct 25, 2019
2,844 views
Five jobs are waiting to be run. Their expected run times are $9, 6, 3, 5,$ and $X$. In what order should they be run to minimize average response time? $($Your answer wi...
0 votes
0 votes
3 answers
4