Day 01Part 14 – Operating system for computer – Concept of process Control Block in very easy way

Day 01Part 14 – Operating system for computer – Concept of process Control Block in very easy way



play-rounded-fill play-rounded-outline play-sharp-fill play-sharp-outline
pause-sharp-outline pause-sharp-fill pause-rounded-outline pause-rounded-fill
00:00

 Process Control Block (PCB) – Explained in an Easy Way

When you run any program on a computer, the operating system (OS) manages it as a process. To track and manage each process efficiently, the OS maintains a Process Control Block (PCB).

 What is a Process Control Block (PCB)?

PCB is a data structure used by the Operating System to store information about a process. It keeps all details needed for process execution and management.

Think of PCB like an Identity Card  for a process, which contains all important details about it.

 Information Stored in PCB

A PCB contains the following essential details:

Component Description
 Process ID (PID) Unique identification number for each process.
 Process State The current state of the process (New, Ready, Running, Waiting, Terminated).
 Program Counter (PC) The memory address of the next instruction to be executed.
 CPU Registers Stores CPU-related data (like accumulator, index registers, etc.).
 Memory Management Info Details about memory allocation (base and limit registers, page tables).
 I/O Information List of input/output devices assigned to the process.
 Scheduling Information Priority, scheduling queue details.
 Accounting Information CPU time used, process creation time, etc.

 How PCB Works?

When a process starts, the OS creates a PCB for it.
When the process runs, the CPU uses PCB data for execution.
If the process is paused or waiting, its PCB keeps track of its state.
When the process finishes, the OS deletes its PCB.

 Process States and PCB

A process moves through different states, and the PCB updates its Process State accordingly.

New → Process is being created.
Ready → Waiting to get CPU time.
Running → Executing instructions.
Waiting → Waiting for input/output operation.
Terminated → Process has finished execution.

 Why is PCB Important?

 Helps the OS manage multiple processes efficiently.
 Saves the state of a process during context switching.
 Stores critical information for process scheduling.

 Simple Example to Understand PCB

Imagine a to-do list  where each task has:

  • Task ID (Process ID)
  • Status (Pending, In Progress, Completed)
  • Assigned Person (CPU registers)
  • Deadline (Scheduling info)

Similarly, the OS maintains PCBs to keep track of all processes running on the system!

Would you like a diagram for better understanding?

Day 01Part 14 – Operating system for computer – Concept of process Control Block in very easy way

Medical gases Health Technical Memorandum 02-01

Chapter 3 Process Description and Control

Operating System



Leave a Reply

Your email address will not be published. Required fields are marked *

error: