Topic 3.2 · Process & Thread Management

Process Control Block (PCB) & Process States

3 min read1 question to test yourself

1Definition

A Process Control Block (PCB) is a vital operating system data structure allocated for every process that stores its operational metadata, including Process ID, Program Counter, CPU registers, process state, priority, memory management pointers, and I/O file descriptors. A process transitions through five primary Process States: New, Ready, Running, Waiting (Blocked), and Terminated.

2Simple Explanation

Think of a PCB as a process's official passport or medical chart. When the OS context-switches the CPU away from an active process, it needs to freeze the process instantly without losing work. It writes the exact instruction line number (Program Counter) and CPU register values into the process's PCB. When the process gets the CPU back later, the OS reads the PCB, restores the registers, and resumes execution seamlessly.

3Real-Life Example / Analogy

A Book Bookmark: When you are reading a 500-page book (running a process) and your phone rings (an interrupt occurs), you put a bookmark (PCB entry with Program Counter value) on Page 142, Line 12 and close the book. When you return, you open the book directly to Page 142, Line 12 and continue reading as if you were never interrupted.

4Diagram / Visual Representation

Admitted

Dispatch

I/O or event wait

I/O / event complete

Interrupt / time slice expires

Exit

NEW

READY

RUNNING

WAITING

TERMINATED

PROCESS CONTROL BLOCK (PCB)

Process ID (PID)

Program Counter

Process State

Priority

CPU Registers

Memory Pointers

I/O Status · Open files · Devices

5Working / How It Works

  • State Lifecycle Transitions:
    1. New -> Ready: OS approves process creation, allocates PCB, loads code into RAM, and places process in Ready Queue.
    2. Ready -> Running: Short-Term Scheduler dispatches process to CPU core.
    3. Running -> Waiting: Process requests I/O access or waits for a semaphore signal.
    4. Waiting -> Ready: I/O operation completes; hardware interrupt moves process back to Ready Queue.
    5. Running -> Ready: CPU time quantum expires or higher-priority process preempts current job.
    6. Running -> Terminated: Execution finishes; PCB metadata cleared from Process Table.

6Types / Components / Characteristics

  • 5 Core Process States:
    • New: Process is currently being initialized.
    • Ready: Process resides in RAM waiting for CPU assignment.
    • Running: Process instructions are executing on CPU core.
    • Waiting (Blocked): Process cannot execute until an I/O completion or event occurs.
    • Terminated: Process completed execution; PCB reclaimed.
  • Process Queues:
    • Job Queue: Processes in secondary disk storage (New state).
    • Ready Queue: Processes residing in RAM waiting for CPU execution.
    • Waiting Queue: Processes awaiting specific I/O devices or events.

7Solved Examples / Problems

Problem: Why does a process transition from Running directly to Ready instead of Waiting when a time slice interrupt occurs? Solution: An I/O request requires external device action, forcing the process into the Waiting state. A time-slice expiration is a purely scheduler-driven interrupt. The process is fully capable of executing immediately, but CPU fairness requires it to yield the core. Therefore, it transitions directly to the Ready state queue.

8Advantages, Disadvantages & Applications

  • PCB Advantages: Enables seamless context switching, multitasking, and robust process isolation.
  • Disadvantages: Large numbers of active PCBs consume OS kernel memory space.

9Important Points to Remember

  • Long-Term Scheduler (LTS / Job Scheduler) controls the Degree of Multiprogramming (number of processes in RAM).
  • Short-Term Scheduler (STS / CPU Scheduler) selects processes from Ready Queue for execution.
  • Dispatcher handles actual CPU context switching and register loading.

10Test Your Understanding

  1. MCQ: Which operating system scheduler component directly controls the Degree of Multiprogramming?
    • A) Short-Term Scheduler (STS)
    • B) Long-Term Scheduler (LTS)
    • C) Medium-Term Scheduler (MTS)
    • D) I/O Dispatcher
    Show answer
    B.
  2. Conceptual Question: List and define 6 key data attributes stored inside a Process Control Block (PCB).
  3. Application Question: Trace the complete process state transition pathway for a program reading a 1GB file from disk.

Finished this topic?

0 of 27 topics read in Operating Systems

Handwritten notes for the exam

Unit-wise SPPU notes and PYQs for this subject.

Helpful? Share it with your class

Free for everyone, no login needed.

Share topic