Consider n processes sharing the CPU in a round-robin fashion. Assuming that…

1998

Consider n processes sharing the CPU in a round-robin fashion. Assuming that each process switch takes s seconds, what must be the quantum size q such that the overhead resulting from process switching is minimized but at the same time each process is guaranteed to get its turn at the CPU at least every t seconds?

  1. A.

    q ≤ (t − ns)/(n − 1)

  2. B.

    q ≥ (t − ns)/(n − 1)

  3. C.

    q ≤ (t − ns)/(n + 1)

  4. D.

    q ≥ (t − ns)/(n + 1)

Attempted by 21 students.

Show answer & explanation

Correct answer: A

In round-robin scheduling with n processes, a process waits for the other n-1 processes to complete their quantum plus context switch overheads. The total wait time is (n-1)q + ns, which must not exceed the maximum allowed interval t. Solving for q yields q ≤ (t - ns)/(n-1). To minimize overhead, the quantum should be maximized within this limit.

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Gate Guidance By Sanchit Sir