Facebook Pixel

Process States in Operating System

When a program is executed, it becomes a process, and throughout its execution, it goes through multiple stages. The operating system controls this process and moves it between different states depending on factors like CPU availability, resource access, and system conditions.

Although different operating systems may use slightly different names for these stages, the core idea remains consistent.

Process State Models
Generally, process states are explained using three standard models: the Two-State Model, the Five-State Model, and the Seven-State Model.

Two-State Model

Two-State Process Model

The simplest process state model: Running and Not Running

This is the most basic representation of process states. In this model, a process can exist in only two conditions:

StateDescription
RunningThe process is actively being executed by the CPU.
Not RunningThe process is not currently using the CPU. It may either be waiting for resources or ready to run.

In this model, when a process is created, it starts in the not running state. Once the CPU becomes available, it is assigned to the process, and the process moves into the running state.

If the process needs to wait for input/output operations or other resources, it returns to the not running state.

The responsibility of assigning the CPU lies with a component called the dispatcher, and this allocation process is known as dispatching.

Five-State Model

Five-State Process Model

Breaking down 'Not Running' into distinct stages

The five-state model provides a more detailed view by breaking down the "not running" state into multiple precise stages.

StateDescription
Start (New)The process is being created and initialized. It is not yet ready for execution.
ReadyThe process is prepared to run and is waiting in a queue for CPU allocation.
RunningThe CPU is actively executing the instructions of this process.
Waiting (Blocked)The process is paused because it is waiting for a resource (e.g., waiting for user input or file access).
Terminated (End)The process has finished execution or has been stopped, and it is removed from the system.

Seven-State Model

Seven-State Process Model

Introducing suspended states for advanced resource management

The seven-state model expands on the five-state model by introducing two additional states related to process suspension.

These additional states help the operating system handle processes more efficiently, especially in systems with limited resources or heavy workloads.

Suspended StateDescription
Suspended ReadyThe process is ready to run but has been temporarily swapped out (paused) by the operating system to free up system memory.
Suspended BlockedThe process is already waiting for a resource, but it has additionally been suspended and moved to secondary storage to manage memory and avoid congestion.
Summary
A process moves through multiple stages during its lifetime to help the OS manage execution effectively. The Two-State Model is the simplest (Running vs Not Running), while the Five-State and Seven-State Models provide increasingly more granularity and resource control.

Fill in the Blank(integer only)

The model expands on the basic execution states by introducing Suspended Ready and Suspended Blocked states to handle memory congestion.

Flashcard

In the Two-State Model, which component is directly responsible for assigning the CPU to a ready process?

Tap to flip
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.