Process States In Os

When a process run on any device it must go through a minimum of four steps that is new, ready, running, and terminated.

New: In this state, the process is about to create but not yet created. Before this state, any process has not yet been created. This state is present in the secondary memory that will pick up by the os to start the execution.

Ready: After the new state process enters into the ready state. In this state, the process is ready to run and waiting for the CPU to execute this process and the process enters into the main memory which is RAM. Long-term schedulers decided how many processes will enter into the ready state from the new state, this decides the degree of multiprogramming means we want to as possible as the maximum amount of process enters into the ready state.

Running: The process chosen by the CPU is executed one by one. In our system CPU is a uniprocessor so cpu performs one task at a time. After one task is completed the CPU only executes the next process. Short time scheduler decides which process enters into the CPU from the ready state and then this will be called dispatch. A dispatch is a software that moves the process from the ready state to running.

Wait/Block: In the running state if the process wants to I/O request and wants to read some file from the secondary memory then cpu moves the process into the block state. When the process completes the i/o request and reads the file it will again move into the ready state. Suppose in the worst case if 10 process resides in the ready state this all 10 state want to read some file from secondary memory then all 10 process moves into block space one by one and the space of wait/block is limited so when this space of wait/block is full the process will move into the suspended secondary memory this is done by the medium term scheduler.

Terminated: In this state, the process is killed and it deallocates the process.