1. Introduction

The Process Control Block (PCB) is one of the most important data structures in an operating system. Every process executing in the system is represented internally by a PCB, making it the primary mechanism through which the operating system manages processes.

The operating system cannot directly manage a process by looking at its program code. Instead, it maintains a PCB that stores all information required to track, control, schedule, suspend, resume, and terminate the process.

Without the PCB, the operating system would have no way to:

  • Identify processes

  • Track execution progress

  • Perform context switching

  • Manage resources

  • Schedule CPU execution

For this reason, the PCB is often described as:

The kernel's representation of a process.

Whenever the operating system needs information about a process, it accesses the corresponding PCB.

The PCB plays a central role in:

  • Process management

  • CPU scheduling

  • Context switching

  • Resource allocation

  • Memory management

Virtually every process-related operation performed by the operating system involves the PCB.

2. Definition

A Process Control Block (PCB) is defined as:

A data structure maintained by the operating system that contains all information required to manage and execute a process.

Each process in the system has its own unique PCB.

The PCB contains:

  • Identification information

  • Process state

  • Execution context

  • Scheduling information

  • Memory management details

  • Resource information

The operating system creates the PCB when a process is created and destroys it when the process terminates.

Important Characteristics

One PCB Per Process

Every process has exactly one PCB associated with it.

Kernel Data Structure

PCBs are maintained by the operating system kernel.

User programs cannot directly access or modify them.

Dynamic Information

The contents of a PCB change continuously during process execution.

Examples:

  • Program counter changes

  • Process state changes

  • CPU usage increases

3. Structure of PCB

A PCB contains multiple fields that collectively describe the complete state of a process.

A conceptual PCB structure can be represented as:

+--------------------------------+
|       Process Control Block    |
+--------------------------------+
| Process ID (PID)               |
| Parent Process ID (PPID)       |
| Process State                  |
| Program Counter                |
| CPU Registers                  |
| Scheduling Information         |
| Memory Management Information  |
| I/O Status Information         |
| Accounting Information         |
+--------------------------------+

Each field serves a specific purpose in process management.

4. Components of PCB

The PCB contains multiple categories of information that together define the process and its execution environment.

4.1 Process Identification

The operating system must uniquely identify every process.

The PCB therefore stores process identification information.

Process ID (PID)

A PID is a unique numerical identifier assigned to each process.

Example:

PID 101 → Browser
PID 102 → Editor
PID 103 → Terminal

The PID allows the operating system to:

  • Track processes

  • Schedule execution

  • Manage resources

  • Support process communication

Parent Process ID (PPID)

The PPID identifies the process that created the current process.

Example:

Parent Process (PID 10)
         |
         +---- Child Process (PID 25)

The operating system uses PPID information to maintain:

  • Process hierarchies

  • Process trees

  • Parent-child relationships

4.2 Process State

The PCB stores the current state of the process.

Typical states include:

  • New

  • Ready

  • Running

  • Waiting (Blocked)

  • Terminated

Example:

Process State = Running

The scheduler uses this information to determine:

  • Whether the process can execute

  • Whether it should wait

  • Whether it has completed

Since process states change frequently, this field is updated continuously.

4.3 Program Counter (PC)

The Program Counter stores:

The address of the next instruction to be executed.

This information is essential because processes may be interrupted at any moment.

Example:

Instruction 100
Instruction 101 ← PC
Instruction 102

When execution resumes:

  • The CPU loads the saved PC value

  • Execution continues from the correct instruction

Without the Program Counter:

  • Processes could not resume correctly after interruption

Importance During Context Switching

When a process is preempted:

Save PC → PCB

When the process resumes:

Restore PC ← PCB

This enables multitasking.

4.4 CPU Registers

The PCB stores the contents of CPU registers.

Registers contain:

  • Intermediate calculations

  • Temporary variables

  • Function parameters

  • Memory addresses

Examples include:

General-Purpose Registers

Used for arithmetic and logical operations.

Stack Pointer (SP)

Points to:

  • Current top of stack

Base Registers

Used for memory addressing.

Index Registers

Used during array and memory access operations.

Example:

R1 = 25
R2 = 40
SP = 0xA120

These values must be preserved when a process is interrupted.

Why Register Information Is Needed

Suppose a process is interrupted while computing:

A + B + C

The intermediate result may already be stored in registers.

Without saving register contents:

  • Computation would be lost

4.5 CPU Scheduling Information

The scheduler uses PCB information to determine execution order.

The PCB stores scheduling-related data such as:

Process Priority

Determines scheduling preference.

Example:

Priority = 10

Higher-priority processes may receive CPU time sooner.

Scheduling Queue Pointers

Used to connect processes to:

  • Ready Queue

  • Waiting Queue

CPU Burst Information

Stores:

  • Previous CPU usage

  • Estimated execution characteristics

Used by scheduling algorithms such as:

  • SJF

  • Priority Scheduling

Importance

This information helps the scheduler:

  • Allocate CPU efficiently

  • Ensure fairness

  • Improve performance

4.6 Memory Management Information

Each process has its own address space.

The PCB stores information needed to manage this memory.

Examples include:

Base Register

Starting address of process memory.

Limit Register

Size of allocated memory region.

Page Tables

Used in paging systems.

Store:

  • Virtual-to-physical address mappings

Segment Tables

Used in segmentation systems.

Address Space Information

Defines:

  • Code region

  • Heap region

  • Stack region

Example:

Page Table Address = 0x4000

The memory management unit (MMU) relies on this information during execution.

4.7 I/O Status Information

Processes often interact with devices and files.

The PCB stores information about these resources.

Open Files

Files currently being used.

Example:

report.txt
database.db
config.ini

Allocated Devices

Examples:

  • Printer

  • Scanner

  • Disk device

Pending I/O Requests

Tracks operations currently in progress.

Example:

Disk Read Request Pending

This information allows the operating system to:

  • Resume I/O correctly

  • Manage device access

  • Prevent conflicts

4.8 Accounting Information

The operating system often tracks process statistics.

The PCB stores accounting information such as:

CPU Usage Time

Amount of CPU consumed.

Example:

CPU Time = 12.4 seconds

Creation Time

Timestamp indicating process creation.

User ID

Identifies process owner.

Resource Usage Statistics

Examples:

  • Memory usage

  • Disk usage

  • I/O operations

Uses

Accounting information is used for:

  • Performance monitoring

  • System administration

  • Resource management

  • Billing in shared systems

5. PCB in Memory

PCBs are typically stored in:

Kernel Space

They are protected from user access to ensure system integrity.

Why Kernel Space?

The PCB contains critical system information.

Allowing user processes to modify PCB contents could:

  • Corrupt execution

  • Bypass security

  • Crash the system

Therefore:

  • Only the operating system kernel can access PCBs directly.

Organization

PCBs are often maintained in a structure called the:

Process Table

6. Role of PCB in Context Switching

6.1 Why PCB is Critical

Context switching is the process of:

  • Suspending one process

  • Resuming another process

This operation is only possible because the PCB stores the complete execution state.

Without the PCB:

  • The operating system would lose process state information.

Multitasking would be impossible.

6.2 Context Switching Flow

The operating system performs the following steps:

Step 1: Save Current Process State

Current execution information is stored in the PCB.

Information saved:

  • Program Counter

  • Registers

  • Process State

CPU → PCB(A)

Step 2: Update Process State

Example:

Running → Ready

or

Running → Waiting

Step 3: Select Next Process

Scheduler chooses another process.

Ready Queue → Process B

Step 4: Load State from PCB

The operating system retrieves:

  • Program Counter

  • Registers

  • Scheduling information

from PCB(B).

PCB(B) → CPU

Step 5: Resume Execution

Process B continues execution exactly where it previously stopped.

6.3 Key Insight

The PCB enables:

Process interruption and later resumption without loss of execution state.

This capability is the foundation of:

  • Multitasking

  • Time-sharing

  • Concurrency

7. Process Table

The operating system maintains a collection of all PCBs called the:

Process Table

Conceptually:

Process Table

+-------+-------+-------+-------+
| PCB1  | PCB2  | PCB3  | PCB4  |
+-------+-------+-------+-------+

Each PCB corresponds to one process.

Purpose of Process Table

The process table enables:

Efficient Process Lookup

Find process information quickly using PID.

Scheduling Support

Access ready and waiting processes.

Resource Tracking

Monitor memory, files, and devices.

System Monitoring

Track execution statistics.

The process table is one of the most important kernel data structures.

8. Relationship with Other Concepts

The PCB connects directly with several major operating system concepts.

Process State Diagram

The PCB stores:

  • Current process state

Examples:

  • Ready

  • Running

  • Waiting

CPU Scheduler

The scheduler reads PCB information such as:

  • Priority

  • Scheduling class

  • Queue information

to make scheduling decisions.

Context Switching

Context switching depends entirely on:

  • Saving state to PCB

  • Restoring state from PCB

Memory Management

The PCB stores:

  • Page tables

  • Address space information

allowing virtual memory translation.

Process Creation

When a new process is created:

  • A new PCB is allocated

Process Termination

When a process terminates:

  • Its PCB is removed