0

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 Answers1

0

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.

Sagar
  • 1,617
  • 9
  • 17
  • So in a non preemptive system When a process WAITs for I/O the CPU remains idle at that time ? – nisha aunty Dec 12 '20 at 21:51
  • Yes, that is correct with one caveat. While waiting for IO, the OS may schedule a process that is in the READY queue to run on the CPU, and move the original process to a WAIT queue associated with the IO device. The CPU would not be idle in this case while waiting for IO. – Sagar Dec 13 '20 at 18:05