The Gateway to Computer Science Excellence

+1 vote

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:

- $Q = \infty$
- $Q > T$
- $S < Q < T $
- $Q = S$
- $Q\: \text{nearly}\: 0$

0 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\%$

- All categories
- General Aptitude 1.9k
- Engineering Mathematics 7.5k
- Digital Logic 2.9k
- Programming and DS 4.9k
- Algorithms 4.4k
- Theory of Computation 6.2k
- Compiler Design 2.1k
- Databases 4.1k
- CO and Architecture 3.4k
- Computer Networks 4.2k
- Non GATE 1.4k
- Others 1.4k
- Admissions 595
- Exam Queries 573
- Tier 1 Placement Questions 23
- Job Queries 72
- Projects 18

50,737 questions

57,292 answers

198,229 comments

104,909 users