Q2. Explain the five state process model with the help of diagram?
Ans. When program executes, it changes state. The whole span can be divided into several stages known as states. Each state of process certain characteristic that describes the process. It means that when process start executing, it goes through one state to another state. Each process may be in one of the following state:
- New : The process is being created.
- Running : Instruction are being executed. When a process gets a control from CPU and other resources, it starts executing.
- Waiting : The process is waiting for some event to occur (such as an input I/O completion or reception of a signal). It is due to process lacks some resources other than the CPU.
- Ready : the ready state requires:
(a) The process is waiting to be assigned to a processor.
(b) All ready queues keep waiting for CPU time to be allocated by operating system in order to run.
(c) A program called scheduler which is part of operating system pick-up one ready process for execution by passing control to it.
- Termination : The process has finished execution.
Only one process can be running on any processor at given moment of time, although many processes may be ready and waiting.
Figure: States of Process