Which state change occurs as a result of non preemptive action

122 views Asked by At

The question I am looking to solve is :
Which state change occurs as a result of non preemptive action

  1. From WAIT to READY
  2. From READY to RUNNING
  3. From RUNNING to READY
  4. From RUNNING to WAIT

As per my understanding as its a non preemptive action. So it cant be 3,1 But not sure any suggestions or comments ?

1

There are 1 answers

2
Sagar On

The general rule of thumb is that if a process can transition from RUNNING to READY not due to it's actions, then the system is preemptive. So, (3) can only occur in a preemptive system. The rest of the options can occur in non-preemptive systems. Here are examples:

  1. WAIT to READY can occur when a process's IO request has been serviced, and is now ready.
  2. READY to RUNNING can occur when a process that was in the run-queue is selected to be executed.
  3. RUNNING to READY only occurs in a preemptive system.
  4. RUNNING to WAIT can occur when a process requests IO, and now has to wait for the IO request to processed.

So, options 1,2, and 4 can occur due to non-preempetive actions.