Process state diagram


A process passes from number of states during its life, states are as follows-
1) New state
2) Ready state
3) Running state
4) Wait state
5) Termination state
6) Suspend ready state
7) Suspend wait state

Description of all the states are as follows-

New State:
First state is known as new state. New state is the state when the process is under creation.
Ready State:
When the process is created new state comes, which is called ready state.

After creation process comes under ready state.

In ready state more than one process can also come.

For example: One process is created at the same time second process is created then both the process will come under ready state.
Running State:
From ready state we have to select a process, and then have to allot CPU to that process for run.

When CPU is allotted to process in ready state that process comes in running state.

In running state only one process can stay at a time. Because CPU can be allotted to single process at a time.
Wait State:
When a process request for input/output than that process will left the running state, and will join new state known as wait state.

In wait state more than one process can stay.
After completion of I/O request process will go to ready state.
From ready state the process will go to again running state.
Termination State:
When process comes in running state, there is no more input output request by the process, because it's already get completed.

So process will go to termination state.
These are the basic states in process state diagram.

Ready state and wait state can contain many processes, so their size gets increases.

Suspend ready state:
When ready state is not able to occupy more states in it, than some states are suspended in suspended state.
Suspend ready state will be in secondary memory not in primary memory.

When ready state get space for new processes than, processes from suspended ready state gets switch back to ready state.

Such transaction is known as resume.
Suspend wait state:
Similarly suspend wait state is also reside in process state diagram.
Non-Preemptive Operating system: If a process is in running state, and we can't remove that process until it get switches to the wait state or termination state, Such type of operating system is known as non-preemptive operating system.

For example:

Process A is in running state, then we can't remove process A, until it gets in wait state or termination state, such type of process is known as non-preemptive process.

Preemptive Operating system: If a process is in running state and its taking too much time in running state then we switches that process to ready state and new process is allotted running state. Then such type of operating system is known as preemptive operating system.

For example:
Ready state, running state and wait state stay in main memory. And we know that size of main memory is very limited.

  1. If process is in new state, it means process is under creation or process is being created.

  1. Once the process is created it will move to the ready state.

  1. In ready state we have multiple number of processes.

  1. One of the process is selected from ready state and it will be dispatched from ready state to the running state.

  1. When the process is in running state, it means it has occupied the CPU.

  1. In the running state there will be only one process.

  1. When running processes require I/O operation, it will move to the wait state.

  1. Wait state can also have multiple number of processes.

  1. The CPU time of the process will be spent in running state.

  1. The I/O time will be spent in wait state.

  1. When the processes is in ready, running, or wait state the processes residing in main memory.

  1. When the resources are not sufficient to manage process in the ready state, then some of the process will be suspended and will be moved to suspend ready state.

  1. When the process is in suspend ready state, the process is residing in secondary memory.

Operating Systems: covered following topics in Operating Systems.
    A list of Video lectures

    Post a Comment

    Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.