Process States, State Transition Diagram & PCB in Operating System

Operating System · Chapter 12

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.

Quick Answer: A process state shows the current condition of a process, such as new, ready, running, waiting or terminated. The state transition diagram shows how a process moves from one state to another. PCB (Process Control Block) is the data record used by the operating system to store important information about a process.
Process Journey at a Glance
NewCreated
→
ReadyWaiting for CPU
→
RunningUsing CPU
WaitingWaiting for event / I/O
↔
ReadyComes back to queue
→
TerminatedFinished

What Are Process States in Operating System?

Process States, State Transition Diagram & PCB 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.

Simple Definition:
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:

1 which process is ready to run
2 which process is currently using the CPU
3 which process is waiting for some event

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 OS
→
admitted
⏳

Ready

The process is prepared to run, but it is waiting for CPU time because some other process may be running.

Waiting for CPU
⚙️

Running

The CPU is currently executing the instructions of this process.

CPU is busy with it
I/O or event wait
↓
interrupt / event complete
🕒

Waiting / 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 finish
🏁

Terminated

The process has completed its work or has been stopped. It leaves the system.

Execution finished
exit
↑
dispatcher / scheduler
🔁

Back to Ready

If CPU time finishes or an event completes, the process may move back to the ready queue.

ready again
New = process created Ready = waiting for CPU Running = currently executing Waiting = waiting for event Terminated = completed

Easy 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.

1
New → Ready
After creation, the process is admitted into memory and becomes ready to run.
2
Ready → Running
The CPU scheduler selects the process, and the dispatcher gives it CPU time.
3
Running → Waiting
The process may request I/O or may need to wait for an event.
4
Waiting → Ready
When the I/O or required event finishes, the process becomes ready again.
5
Running → Ready
If the CPU time slice ends, the process goes back to the ready queue.
6
Running → Terminated
When the process completes its work, it exits.
Easy exam line:
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.

1
New: You open the browser. The process is created.
2
Ready: The browser is ready to run and waiting for CPU time.
3
Running: The browser is using the CPU and starting the download.
4
Waiting: The browser waits for data from the internet or disk I/O.
5
Ready Again: Data comes, so the process is ready to continue.
6
Terminated: You close the browser or the task finishes.

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.

Simple Definition:
PCB is a data structure used by the operating system to store all important information about a process.

Pictorial Explanation of PCB

PCB Record
Process ID (PID) unique identity of process
Process State ready / running / waiting etc.
Program Counter next instruction address
CPU Registers current CPU working values
Scheduling Info priority, queue details, CPU info
Memory Info base/limit, page table, memory details
I/O Status Info open files, devices, I/O requests
Accounting Info CPU time, user/job data etc.
Why PCB is important?
The operating system uses PCB to manage the process and to continue its execution correctly later.
Context switching connection:
When CPU changes from one process to another, the OS saves the current process details in its PCB.
Easy idea:
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.
Memory Trick for PCB:

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.

1
Process A is running and using the CPU.
2
CPU switch happens because another process must run.
3
OS saves Process A details in its PCB.
4
Later OS restores those details and Process A continues from the correct point.

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

Mistake 1:
Thinking that ready state means the process is already running.
Mistake 2:
Thinking that waiting state also uses CPU. It usually does not.
Mistake 3:
Forgetting that a process may move from running back to ready.
Mistake 4:
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:

  1. define process states
  2. name the five states
  3. explain ready and running difference
  4. define state transition diagram
  5. define PCB and write its main contents

10-Mark Answer

Explain in order:

  1. meaning of process state
  2. all five process states with explanation
  3. state transition diagram with transitions
  4. real-life example
  5. definition of PCB
  6. main fields of PCB
  7. role of PCB in process management and context switching

Quick Check Questions

Q1. What is a process state?
Q2. What is the difference between ready and running state?
Q3. When does a process move from running to waiting?
Q4. What does the state transition diagram show?
Q5. What is PCB in operating system?
Q6. Why is PCB important?
Q7. Which PCB field stores the next instruction address?

Quick Revision

New: process is being created
Ready: process is waiting for CPU
Running: process is using CPU
Waiting: process is waiting for I/O or event
Terminated: process has finished
State Transition Diagram: shows movement between states
PCB: process record maintained by OS
Program Counter: next instruction address
Context Switching: PCB helps save and restore process info
Important Confusion: PCB is not a state

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.

Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.
Join Telegram Exam updates and free resources