Download the BYJU'S Exam Prep App for free GATE/ESE preparation videos & tests - Download the BYJU'S Exam Prep App for free GATE/ESE preparation videos & tests -

Process State in Operating System

A process is more than just a set of instructions. It contains information such as the process stack, the program counter, and the contents of the process register, among other things. When a process runs, it modifies the state of the system. The current activity of a given process determines the state of the process in general.

In this article, we will dive deeper into the Process State in Operating System according to the GATE Syllabus for (Computer Science Engineering) CSE. Let us read ahead to learn more.

Table of Contents

What are the Process States in Operating System?

From start to finish, the process goes through a number of stages. A minimum of five states is required. Even though the process could be in one of these states during execution, the names of the states are not standardised. Throughout its life cycle, each process goes through various stages. They are:

New State

When a program in secondary memory is started for execution, the process is said to be in a new state.

Ready State

After being loaded into the main memory and ready for execution, a process transitions from a new to a ready state. The process will now be in the ready state, waiting for the processor to execute it. Many processes may be in the ready stage in a multiprogramming environment.

Run State

After being allotted the CPU for execution, a process passes from the ready state to the run state.

Terminate State

When a process’s execution is finished, it goes from the run state to the terminate state. The operating system deletes the process control box (or PCB) after it enters the terminate state.

Block or Wait State

If a process requires an Input/Output operation or a blocked resource during execution, it changes from run to block or the wait state.

The process advances to the ready state after the I/O operation is completed or the resource becomes available.

Suspend Ready State

If a process with a higher priority needs to be executed while the main memory is full, the process goes from ready to suspend ready state. Moving a lower-priority process from the ready state to the suspend ready state frees up space in the ready state for a higher-priority process.

Until the main memory becomes available, the process stays in the suspend-ready state. The process is brought to its ready state when the main memory becomes accessible.

Suspend Wait State

If a process with a higher priority needs to be executed while the main memory is full, the process goes from the wait state to the suspend wait state. Moving a lower-priority process from the wait state to the suspend wait state frees up space in the ready state for a higher-priority process.

The process gets moved to the suspend-ready state once the resource becomes accessible. The process is shifted to the ready state once the main memory is available.

Important Notes

Note – 01:

A process must pass through at least four states.

  • A process must go through a minimum of four states to be considered complete.
  • The new state, run state, ready state, and terminate state are the four states.
  • However, in case a process also requires I/O, the minimum number of states required is 5.

Note – 02:

Only one process can run at a time on a single CPU.

  • Any processor can only handle one process at a time.
  • When there are n processors in a system, only n processes can run at the same time.

Note – 03:

Present in Memory State
Secondary Memory New state
Main Memory Ready state
Main Memory Run state
Main Memory Wait state
Secondary Memory Suspend wait state
Secondary Memory Suspend ready state

Note – 04:

It is much more preferable to move a given process from its wait state to its suspend wait state.

  • Consider the situation where a high-priority process comes, and the main memory is full.
  • Then there are two options for making space for it. They are:
  1. Suspending the processes that have lesser priority than the ready state.
  2. Transferring the lower-priority processes from wait to the suspend wait state.

Now, out of these:

  • Moving a process from a wait state to a suspend wait state is the superior option.
  • It is because this process is waiting already for a resource that is currently unavailable.

Keep learning and stay tuned to get the latest updates on GATE Exam along with GATE Eligibility Criteria, GATE 2023, GATE Admit Card, GATE Syllabus, GATE Previous Year Question Paper, and more.

 

Also Explore,