CS FundamentalsVery hardProduct company interview · GATE level
Round Robin is used with a quantum of 4 ms and a context-switch time of 1 ms. There are always 10 CPU-bound processes ready and none does I/O. What fraction of CPU time does useful work, and how long does a process wait between the end of one of its quanta and the start of its next?
- A. 80%; 46 ms
- B. 80%; 36 ms
- C. 75%; 46 ms
- D. 80%; 45 ms
Correct answer: A. 80%; 46 ms
Every 4 ms quantum is followed by a 1 ms switch, so useful work is 4/(4 + 1) = 80%. After a process's quantum ends, each of the other 9 processes needs a switch in plus its 4 ms quantum, and then one more switch brings the CPU back: 10 x 1 + 9 x 4 = 46 ms. 36 ms ignores the switches, 45 ms forgets the final switch back, and 75% divides the switch time by the quantum alone. Raising efficiency to 90% would need a 9 ms quantum and a gap of 91 ms - the usual trade-off between overhead and response time.
More Operating Systems questions
- A TLB has 64 entries. With 4 KB pages, what is its reach (the memory it can map without a miss)? If 16 of the entries instead map 2 MB…
- Processes (arrival, burst) in ms: P1 (0, 10), P2 (1, 6), P3 (3, 2), P4 (5, 4), P5 (6, 1). Under preemptive SJF (SRTF), what is the average…
- Processes (arrival, burst) in ms: A (2, 6), B (3, 2), C (4, 1), D (12, 3), E (13, 2). The CPU is idle until the first arrival. Under…
- Round Robin, quantum 3 ms. Processes (arrival, burst): P1 (0, 7), P2 (1, 5), P3 (2, 3), P4 (4, 6). A process arriving at the same instant…
- Three CPU-bound processes arrive at time 0 in the order A (burst 5), B (burst 3), C (burst 8). Round Robin with quantum 2 is used. Not…
- Processes (arrival, burst): P1 (0, 3), P2 (2, 6), P3 (4, 4), P4 (6, 5), P5 (8, 2). Under non-preemptive Highest Response Ratio Next…