Process States, State Transition Diagram & PCB in Operating System
Many students understand what a process is, but they get confused when the book starts using words like new, ready, running, waiting, terminated and then adds a state transition diagram and PCB. The topic looks difficult because many things are taught together.
The good news is that the basic idea is actually simple. A process does not stay in one condition forever. It keeps moving from one state to another depending on what the CPU and operating system are doing. The OS also keeps a record of every process. That record is called PCB.
What Are Process States in Operating System?
A process is not always doing the same work. Sometimes it is waiting for the CPU. Sometimes it is running on the CPU. Sometimes it is waiting for input or output work to complete. Because of this, the operating system keeps track of the current condition of the process. That current condition is called the process state.
A process state shows what a process is doing at a particular moment.
Why do we need process states?
If many processes are present in the system, the operating system must know:
Main Process States
In the basic process model, there are five main states:
New
The process is being created. It has entered the system, but it has not started normal execution yet.
Created by OSReady
The process is prepared to run, but it is waiting for CPU time because some other process may be running.
Waiting for CPURunning
The CPU is currently executing the instructions of this process.
CPU is busy with itWaiting / Blocked
The process cannot continue right now because it is waiting for some event, such as input, output or a resource.
Waiting for work to finishTerminated
The process has completed its work or has been stopped. It leaves the system.
Execution finishedBack to Ready
If CPU time finishes or an event completes, the process may move back to the ready queue.
ready againEasy Explanation of Each Process State
1. New State
When a user opens a program or when the system creates a new task, the process first enters the new state.
- process is just created
- required resources are being arranged
- execution has not started normally
2. Ready State
Now the process is ready to run, but it must wait because the CPU may already be busy with another process.
- all needed things are mostly ready
- process is in the ready queue
- just waiting for CPU time
3. Running State
This means the process is currently using the CPU and its instructions are being executed.
- actual execution is happening
- only one process per CPU core can run at a time
- process may continue, wait, or finish
4. Waiting / Blocked State
Sometimes a running process cannot continue because it needs something else, such as keyboard input, file access or printer output.
- process is not ready to use CPU now
- it is waiting for an event or I/O completion
- after the event completes, it returns to ready state
5. Terminated State
This is the final state. The process has finished its work, or the operating system has stopped it.
- execution ends
- resources are released
- process leaves the active system flow
State Transition Diagram in Operating System
A state transition diagram is a visual diagram that shows how a process moves from one state to another. Students usually remember the states, but they forget why the state changes. So let us understand the movement in a simple way.
After creation, the process is admitted into memory and becomes ready to run.
The CPU scheduler selects the process, and the dispatcher gives it CPU time.
The process may request I/O or may need to wait for an event.
When the I/O or required event finishes, the process becomes ready again.
If the CPU time slice ends, the process goes back to the ready queue.
When the process completes its work, it exits.
The state transition diagram shows the movement of a process among new, ready, running, waiting and terminated states.
Real-Life Example of Process States
Suppose you open a browser and download a file.
This example shows that one process may move between states many times before it finally ends.
Running State vs Ready State
This is one of the most common confusions.
| Point | Ready State | Running State |
|---|---|---|
| Meaning | Process is prepared to run. | Process is currently using CPU. |
| CPU | Not using CPU yet. | Using CPU now. |
| Location | Ready queue | Processor execution |
| Simple memory trick | Ready = waiting for chance | Running = chance mil gaya |
What Is PCB in Operating System?
Now let us move to the second important part of this chapter.
When many processes are present, the operating system must store information about each one. It cannot manage processes properly without keeping a record. That record is called the Process Control Block, or PCB.
PCB is a data structure used by the operating system to store all important information about a process.
Pictorial Explanation of PCB
The operating system uses PCB to manage the process and to continue its execution correctly later.
When CPU changes from one process to another, the OS saves the current process details in its PCB.
PCB is like the process's official file or record card inside the operating system.
Main Contents of PCB
| PCB Field | Meaning in Simple Language |
|---|---|
| Process ID | A unique number used to identify the process. |
| Process State | Tells whether the process is new, ready, running, waiting or terminated. |
| Program Counter | Stores the address of the next instruction to be executed. |
| CPU Registers | Stores current working values used by CPU. |
| CPU Scheduling Information | Stores priority, queue information and scheduling data. |
| Memory Management Information | Stores information about memory allocated to the process. |
| Accounting Information | Stores CPU usage or other accounting-related data. |
| I/O Status Information | Stores information related to files and I/O devices. |
Think of PCB as a process report card.
It tells: who the process is, what state it is in, where it will continue, and what resources it is using.
How PCB Helps in Context Switching
When the CPU stops one process and starts another, the operating system must save the first process's details. Otherwise, when that process gets CPU again, it will not know from where to continue.
So the OS stores its information in the PCB. Later, when the process runs again, the OS reads that PCB and restores the process.
Process vs Program vs PCB
Students often mix these three words. Let us separate them clearly.
| Term | Simple Meaning |
|---|---|
| Program | A set of instructions stored in a file. |
| Process | A program that is currently in execution. |
| PCB | The record maintained by the OS about that process. |
Common Mistakes Students Make
Thinking that ready state means the process is already running.
Thinking that waiting state also uses CPU. It usually does not.
Forgetting that a process may move from running back to ready.
Thinking PCB is a process state. PCB is not a state. It is a record.
Exam Preparation
2-Mark Answer
Process state shows the current condition of a process, such as new, ready, running, waiting and terminated. PCB is a data structure used by the operating system to store information about a process.
5-Mark Answer
Write these points:
- define process states
- name the five states
- explain ready and running difference
- define state transition diagram
- define PCB and write its main contents
10-Mark Answer
Explain in order:
- meaning of process state
- all five process states with explanation
- state transition diagram with transitions
- real-life example
- definition of PCB
- main fields of PCB
- role of PCB in process management and context switching
Quick Check Questions
Quick Revision
Frequently Asked Questions
What are process states in operating system?
Process states show the current condition of a process, such as new, ready, running, waiting and terminated.
What is the ready state in OS?
In the ready state, the process is prepared to run but is waiting for CPU time.
What is the difference between ready and running state?
In ready state, the process is waiting for CPU. In running state, the process is currently using the CPU.
What is a state transition diagram?
A state transition diagram is a diagram that shows how a process moves from one state to another.
What is PCB in operating system?
PCB stands for Process Control Block. It is the data structure used by the operating system to store information about a process.
What information is stored in PCB?
PCB stores process ID, process state, program counter, CPU registers, scheduling information, memory information and I/O details.
How is PCB related to context switching?
During context switching, the OS saves the current process details in its PCB and restores them later when the process runs again.
Conclusion
Process states become easy when you see them as the journey of a running task. First the process is created, then it waits for CPU, then it runs, then it may wait for I/O, and finally it completes.
The state transition diagram simply shows this movement visually. The PCB stores all the important details of the process so the operating system can manage it correctly.
If you remember these three ideas clearly — state, transition and record — then this chapter becomes much easier to understand and write in exams.
