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-
First state is known as new state. New state is the state when the process is under creation.
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.
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.
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.
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.
Ready state, running state and wait state stay in main memory. And we know that size of main memory is very limited.