CS FundamentalsVery hardGATE CS
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 counting the initial dispatch, how many context switches occur (a switch happens whenever a different process is dispatched; consecutive slices of the SAME process need no switch)?
- A. 8
- B. 16
- C. 3
- D. 7
Correct answer: D. 7
Slices: A | B | C | A | B | C | A | C | C. A switch occurs at each boundary between different processes: 7; the last two C slices run back to back. Counting every slice boundary gives 8, 16 is the total CPU time, and 3 assumes one switch per process.
More Operating Systems questions
- 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…
- Processes (arrival, burst, priority) with a smaller number meaning higher priority: P1 (0, 4, 3), P2 (1, 3, 2), P3 (2, 1, 4), P4 (3, 5…
- Processes (arrival, burst): P1 (0, 6), P2 (1, 4), P3 (2, 7), P4 (3, 2). Round Robin with quantum 2 ms (new arrivals join the queue before…
- Processes (arrival, burst) in ms: A (0, 4), B (1, 3), C (2, 2). Round Robin with quantum 2 ms; every switch from one process to a…
- Processes (arrival, burst): P1 (0, 8), P2 (1, 5), P3 (2, 2), P4 (4, 1), P5 (6, 4), scheduled by SRTF. How many times is a running process…
- Under FCFS, a long job L (burst 20) and three short jobs (burst 2 each) are scheduled. Case 1 arrivals: L at 0, S1 at 1, S2 at 1, S3 at 2…