Operating Systems | Process: State Transition

The new state is condition of program which is about to be created. Once the creation operation in done, the program will turn to a process in ready state at main memory.

The scheduler dispatches the process to CPU to run the process. Once the execution is completed, there will be deallocation of memories which was allocated run the program, so the process gets terminated.

There are two major cause for preemption from running state

  1. Arrival of high priority job which will lead to sending of current executing process back to run state .
  2. if a process requests for I/O during it's running state, CPU will move it to wait/bock state and continues the execution with another one, and the process in the block state which may send back to run state if it completes the I/O.

Arrival of an higher priority job/process when main memory is full, causes for the suspension of less important existing job.

If the suspension is for a process in wait state , resulting state is called suspend wait and if it was for a process in ready state , resulting state is called suspend ready.

A process is suspend ready state or suspend wait can resume back to ready and wait state respectively, when there is no process which has higher priority than these processes.

If a process in suspend wait completes it's I/O, and if it does not find any fittest place with reference to any criteria for getting back to run state, it will shift into suspend ready state.

  • Jobs are represented as queues in each state(ready queue, block queue...) which are implemented using data structure linked list
  • Burst Time, Arrival Time, Priority, size of process... are the common criteria used by the schedulers
  • I/O requests, events, timers, priority and fork() command are the common cause for preemption from CPU.
  • Transitions among various states are done by different schedulers
    • NEW to READY : Long Term Scheduler(LTS)
    • READY to SUSPEND READY : Medium Term Scheduler(MTS)
    • READY to RUN : Short Term Scheduler(STS)