Learning outcomes
- Explain the different process states and illustrate them using a state transition diagram.
Explain the different process states and illustrate them using a state transition diagram.
A process is a program in execution. While executing, a process does not remain in one condition all the time. It moves through a number of states depending on whether it is being created, waiting for the CPU, running on the CPU, waiting for an event, or finishing execution.
These states help the operating system keep track of process activity and make scheduling decisions correctly. Although different operating systems may use slightly different names, the standard model commonly includes five basic states: new, ready, running, waiting, and terminated.
A process state tells us what the process is doing at a particular moment and whether it is eligible to use the CPU.
The standard model commonly includes five basic states. The table below summarizes their roles and triggers:
| State | Description & Activity | Typical Trigger / Next Step |
|---|---|---|
| New | The process is being created; the OS is allocating required data structures. | Moves to Ready once admitted into the system. |
| Ready | In main memory, completely ready to run, but waiting for CPU assignment. | Moves to Running when selected by the dispatcher. |
| Running | The process's instructions are currently being executed by the CPU. | Moves to Waiting (I/O), Ready (Interrupt), or Terminated. |
| Waiting / Blocked | The process cannot continue until a specific event occurs (e.g., I/O completion). | Moves back to Ready once the event completes. |
| Terminated | The process has finished execution or was stopped permanently. | Final state; the OS deallocates its resources. |
The operating system may manage many processes at the same time. Some may be waiting for the CPU, some may be performing I/O, and one may be running. By maintaining process states, the operating system can:
A process changes its state because of system events such as admission, dispatch, I/O requests, I/O completion, interruptions, or exit. These movements are shown using a state transition diagram.
Processes in the ready state wait in the ready queue for CPU service. Processes in the waiting state are usually placed in waiting queues associated with specific I/O devices or events.
This separation is important because a waiting process is not ready to use the CPU, while a ready process is fully prepared to run but is waiting only for processor allocation.
Ready means the process is fully able to run but lacks a CPU.
Waiting means the process is blocked and cannot run yet, even if the CPU becomes completely free.
The process state model is closely related to the different schedulers:
For the basic state diagram, the short-term scheduler is the most directly involved because it controls the rapid, continuous transitions between the ready and running states.
Understanding process states is essential because many operating system topics depend on them. CPU scheduling chooses among ready processes. Synchronization may cause processes to wait. I/O operations frequently move processes from running to waiting and back again.
In short, the process state transition diagram is one of the most fundamental models in operating systems. It provides a clear picture of how the OS manages process execution from creation to completion.
Consider a process P1 submitted by a user.
State sequence:
New → Ready → Running → Waiting → Ready → Running → Terminated
This example shows that a process may enter the running state more than once before termination, especially when I/O operations are involved.
A process is a program in execution. During its lifetime, a process moves through different states. The common five-state model includes new, ready, running, waiting, and terminated.
In the new state, the process is being created. In the ready state, it is in memory and waiting for CPU allocation. In the running state, its instructions are being executed by the CPU. In the waiting state, it is waiting for an event such as I/O completion. In the terminated state, it has finished execution.
The process state transition diagram shows how a process moves from one state to another. A new process is admitted to the ready state. The scheduler dispatches a ready process to the running state. A running process may move to waiting when it requests I/O, return to ready after I/O completion, move back to ready if it is preempted, or move to terminated when execution ends.
The ready state and waiting state are different. A ready process can run as soon as the CPU becomes available. A waiting process cannot run yet because it is waiting for some event.
Process states are important because they form the basis of CPU scheduling, synchronization, I/O handling, and general process management in the operating system. The state transition diagram provides a compact and clear model of how the operating system controls process execution from creation to completion.