Question:

Consider four processes P, Q, R, and S scheduled on a CPU as per round robin algorithm with a time quantum of 4 units. The processes arrive in the order P, Q, R, S, all at time \(t = 0\). There is exactly one context switch from R to Q, and exactly two context switches from Q to R. There is no context switch from S to P. Switching to a ready process after the termination of another process is also considered a context switch. Which one of the following is NOT possible as CPU burst time (in time units) of these processes?

Show Hint

In round-robin scheduling, each process gets a fixed time slice. The number of context switches depends on the burst times and the quantum.
Updated On: Jan 30, 2026
  • P = 4, Q = 10, R = 6, S = 2
  • P = 2, Q = 9, R = 5, S = 1
  • P = 4, Q = 12, R = 5, S = 4
  • P = 3, Q = 7, R = 7, S = 3
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is D

Solution and Explanation

In a round-robin scheduling algorithm with a time quantum of 4 units, processes are scheduled in a cyclic manner. A context switch occurs each time the CPU switches from one process to another. The key to solving this problem is understanding how the number of context switches correlates with the burst times of the processes. Here's how we evaluate each option: - Option (A) P = 4, Q = 10, R = 6, S = 2: The time quantum is 4, so after the first time slice, process P will have completed its execution (as its burst time is 4). After that, the remaining processes Q, R, and S will continue executing in a round-robin manner. There will be a context switch from R to Q, and two context switches from Q to R, so this scenario is possible. - Option (B) P = 2, Q = 9, R = 5, S = 1: With a time quantum of 4, process P will complete its execution after 2 units. Q will then get its turn. Since Q's burst time is 9, it will need two full time quanta, which would result in a context switch from Q to R. This situation is also feasible. - Option (C) P = 4, Q = 12, R = 5, S = 4: This scenario is also possible. P completes in the first time quantum, and Q will run for two time slices (totaling 8 units), followed by context switches as necessary to execute R and S. - Option (D) P = 3, Q = 7, R = 7, S = 3: In this scenario, when P finishes its 3 units of burst time, it will require a context switch to Q. However, the burst times of Q and R are both greater than the time quantum, leading to two context switches from Q to R. Since no context switch occurs from S to P in this scenario, the result violates the round-robin execution pattern. This option is not feasible. Thus, the answer is (D).
Was this answer helpful?
0
0

Top Questions on CPU Scheduling

View More Questions