204 views
5 5 votes

A single-CPU system contains three processes with priorities:

$$X > Y > Z$$

The scheduler always runs the highest-priority runnable process and performs preemption when necessary.

At a particular point:

  • $X$ is BLOCKED waiting for disk I/O.
     
  • $Y$ is RUNNING.
     
  • $Z$ is READY.

The disk I/O requested by $X$ now completes.

What are the states immediately after the scheduler reacts?

  1. $X$: READY, $Y$: RUNNING, $Z$: READY
     
  2. $X$: RUNNING, $Y$: READY, $Z$: READY
     
  3. $X$: RUNNING, $Y$: BLOCKED, $Z$: READY
     
  4. $X$: READY, $Y$: READY, $Z$: RUNNING

1 Answer

4 4 votes

Initially:

  • $X$ is BLOCKED because it is waiting for disk I/O.
     
  • $Y$ is RUNNING because $X$ is unavailable.
     
  • $Z$ is READY.

Now, the disk I/O of $X$ completes.

This causes the transition:

$X:$ BLOCKED $\rightarrow$ READY

At this moment, both $X$ and $Z$ are ready, while $Y$ is currently running.

Given the priority order:

$$X > Y > Z$$

$X$ has a higher priority than the currently running process $Y$. Since the scheduler is preemptive, $X$ immediately preempts $Y$.

Therefore:

  • $X$: READY $\rightarrow$ RUNNING
     
  • $Y$: RUNNING $\rightarrow$ READY
     
  • $Z$: remains READY

So the final states are:

$X:$ RUNNING,$\quad Y:$ READY, $\quad Z:$ READY


Answer : B

Answer:
Position:
Show:

Related questions

4 4 votes
1 1 answer
245
245 views
GO Classes asked Jul 18
245 views
Which of the following statements are correct?The CPU dispatcher determines the policy for which process should be run and when. With cooperative multitasking, it is poss...
6 6 votes
1 1 answer
224
224 views
GO Classes asked Jul 18
224 views
According to the standard process-state model, which of the following transitions are valid?A RUNNING process may move to the WAITING state when it blocks for an event su...
1 1 vote
1 1 answer
168
168 views
GO Classes asked Jul 18
168 views
Consider a single-CPU system with processes $A$, $B$, and $C$.The following events have occurred:$A$ begins execution. $A$ creates $B$, and $B$ is scheduled. The running ...
3 3 votes
1 1 answer
109
109 views
GO Classes asked Aug 29
109 views
Three processes enter the ready queue as follows. A larger priority value means higher priority.$$\begin{array}{|c|c|c|c|}\hline\text{Process} & \text{Arrival Time} & \te...