IAE Academy

GATE 2024 CS1 Q.25: solution and answer

GATE 2024 · CS1Q.25 · 1 mark · MSQ

Which of the following process state transitions is/are NOT possible?

  1. (A)

    Running to Ready

  2. (B)

    Waiting to Running

  3. (C)

    Ready to Waiting

  4. (D)

    Running to Terminated

See the question in the paper

Answer and solution

ANSWER

The transitions that are not possible are (B) Waiting to Running and (C) Ready to Waiting.

Official answer: B, CSource: Official answer key, GATE 2024 CS1 (IISc Bengaluru)

  1. Use the five-state process model: New, Ready, Running, Waiting (Blocked), Terminated. The legal transitions are New to Ready, Ready to Running (dispatch), Running to Ready (preemption or time-slice expiry), Running to Waiting (I/O or event wait), Waiting to Ready (I/O or event completion) and Running to Terminated (exit).

  2. (A) Running to Ready: possible. A timer interrupt or the arrival of a higher-priority process preempts the running process and puts it back in the ready queue.

  3. (B) Waiting to Running: not possible. When the awaited event completes, the process moves to Ready and must wait for the scheduler to dispatch it. It never goes from Waiting straight onto the CPU.

  4. (C) Ready to Waiting: not possible. A process blocks only by executing a blocking call, such as an I/O request. A Ready process is not executing, so it cannot make that call.

  5. (D) Running to Terminated: possible. The process finishes or calls exit.

  6. The transitions that are NOT possible are (B) and (C).

KEY IDEA

In the five-state model a blocked process can only go Waiting to Ready, and only a Running process can block. So Waiting to Running and Ready to Waiting cannot occur.

WATCH OUT FOR

Treating a process that has just received its I/O as running at once (Waiting to Running), or thinking a Ready process can be moved to Waiting. Blocking is something a running process does to itself.

From the GATE 2024 CS1 paper. Every question of this paper · Download the full paper · All 9 Processes & threads questions, with notes

More Processes & threads questions