CS FundamentalsHardGATE CS
Processes typically run 40 ms of CPU before blocking for I/O. Round Robin uses a quantum of 8 ms and each context switch costs 2 ms. What fraction of CPU time does useful work?
- A. 80%
- B. 95%
- C. 75%
- D. 67%
Correct answer: A. 80%
Each 40 ms burst is cut into 5 quanta, each followed by a 2 ms switch, so 40 ms of work costs 40 + 10 = 50 ms: 80%. Using q / (q + s) = 8/10 gives the same here because the burst is a multiple of q.
More Operating Systems questions
- Three users run the same 60 KB editor (pure, reentrant code) and each has 20 KB of private data. With paging that lets the code pages be…
- In a monitor with Mesa (signal-and-continue) semantics, why must a consumer write while (count == 0) wait(notEmpty); instead of if (count…
- In the first readers-writers solution (readers share a count; the first reader locks out writers and the last reader lets them in), what…
- Five philosophers each pick up their left fork and then their right fork. Which change removes the possibility of deadlock without adding…
- Two processes use while (lock) ; lock = 1; / CS / lock = 0; with a plain shared variable (no atomic instruction). Which requirement of the…
- In Peterson's algorithm for P0 and P1, the entry code for Pi is flag[i] = true; turn = j; while (flag[j] && turn == j);. What goes wrong…