Operating SystemProgress: 0/2 completed
Subjects/Operating System

Process & PCB Concept

Easy
12 mins read
Prerequisites
  • Basic Computer Organization
  • What is RAM and CPU?

Introduction

Operating System ko simple language me samjho. Jab tum mobile chalate ho aur WhatsApp aur YouTube ek sath open karte ho, tab jo system background me decide karta hai ki kis app ko CPU kitni der milegi, usse Operating System kehte hain. Program on disk is just dead code, par jab wo memory me load hokar CPU par execute hone lagta hai, toh use hum Process kehte hain.

Real-Life Analogy

💡 Restaurant Kitchen Analogy

Kitchen counter, Chef and Cooking Process

Concept TermReal-life Analogy Mapping
CPUKitchen Chef (jo actually kaam karta hai)
ProcessCustomer's Food Order (jo execute hona hai)
Ready QueueKitchen counter jahan orders queue me lagte hain
ExecutionChef cooking the food
Waiting StateChef waiting for raw ingredients from storehouse

Detailed Concept Explanation

Ek process computer memory (RAM) me layout hota hai. Iske 4 primary parts hote hain: 1. **Text Section**: Jisme compile kiya hua machine code hota. 2. **Data Section**: Global and static variables store hote hain. 3. **Heap Section**: Dynamic memory allocation (like malloc in C) ke liye. 4. **Stack Section**: Local variables, return parameters, aur function calls store karne ke liye. Har process ke data ko manage karne ke liye OS ek block banata hai jise **Process Control Block (PCB)** bolte hain. PCB me Process State, PC (Program Counter), CPU Registers, CPU Scheduling Info, Memory Management Info, aur I/O Status save rehta hai.

Visual Diagram

Newdisk pe program
ReadyRAM Ready Queue
Dispatch
RunningCPU execution
TerminatedExit / Finished
I/O Wait
Waiting / BlockedI/O or Event
I/O Done
Note: Ready state queue holds processes waiting for CPU scheduler assignment.
Important Point
  • Program disk par physical state me hota hai (Passive Entity), jabki Process RAM me active running state me hota hai (Active Entity).
  • Program Counter (PC) store karta hai agle instructions ka address jo execute hona hai.
  • PCB is stored in Kernel space of Memory.
Mnemonic / Memory Trick

P-P-S-A-M-I (Pappu Pyare Soja, Aise Mat Itra)

Process state, Program counter, Stack pointer, Allocations (resources), Memory limits, I/O list

Mnemonic to remember PCB elements structure for GATE exam.
Avoid This Common Mistake
Kayi baar students Program aur Process ko same samajhte hain. Yaad rakhna: Program dynamic nahi hai, Process dynamic hai. Ek Program ke multiple Processes ho sakte hain.
GATE Exam Insights
GATE me Context Switching aur PCB parameters par directly conceptual questions aate hain. Context switching overhead directly affects system throughput.

Practice Mini Quiz

Revision Summary (One-Page Notes)

  • Process is a program in execution.
  • It is represented in the OS by PCB.
  • PCB contains ID, state, counter, registers, etc.
  • States include New, Ready, Running, Waiting, Terminated.
  • Transition is controlled by Schedulers.
Next Topic