1
39kviews
Draw the process state transition diagram and explain the transitions of state.i) running to ready ii) waiting to ready iii) running to waiting iv) blocked to ready v) running to terminated
1 Answer
6
4.6kviews

Solution:

shows the state transition diagram for the process states defined above:

enter image description here Logically, the first two state are similar. In both case the process is willing to run, but in the ready state there is no CPU temporarily available for it.

(I) Running to ready state:

  • A process in the running state has all of the resources that it needs for further execution, including a processor.
  • The long term scheduler picks up a new process from second memory and loads it into the main memory when there are sufficient resources available.
  • The process is now in ready state, waiting for its execution.

(II) waiting to ready:

  • Process waiting for some event such as completion of I/O operation, synchronization signal, etc.

  • A process moves from waiting state to ready state if the event the
    process has been waiting for, occurs.

  • The process is now ready for execution.

(III) Running to waiting:

  • The process in the main memory that is waiting for some event.

  • A process is put in the waiting state if it must wait for some event. For example, the process may request some resources or memory which might not be available.

  • The process may be waiting for an I/O operation or it may be waiting for some other process to finish before it can continue execution.

(IV) blocked to ready:

  • The process is in secondary memory but not yet ready for execution.

  • The process moves from Blocked to Ready state if the event, the process has been waiting for occurs.

(v) Running to terminated:

  • The process has finished execution.

  • The OS moves a process from running state to terminated state if the process finishes execution or if it aborts.

  • Whenever the execution of a process is completed in running state, it will exit to terminate state, which is the completion of process.

Please log in to add an answer.