Processes in Operating System (OS)
1. What is a Process?
A process is a program in execution. It consists of program code, data, and system
resources allocated by the operating system.
2. Process vs Program
Program Process
A passive entity (code stored in a file) An active entity (code in execution)
Does not consume CPU or memory Uses CPU, memory, and resources
Cannot be scheduled by the OS Scheduled and managed by the OS
3. Process States
A process goes through different states during execution:
New – The process is being created.
Ready – The process is waiting for CPU allocation.
Running – The process is executing on the CPU.
Blocked (Waiting) – The process is waiting for an I/O operation to complete.
Terminated – The process has finished execution.
🚀 Note: The OS scheduler moves processes between these states based on CPU
availability and resources.
4. Process Control Block (PCB)
The Process Control Block (PCB) is a data structure maintained by the OS for each
process. It contains:
✅ Process ID (PID) – Unique identifier for the process.
✅ Process State – Current state of the process.
✅ Program Counter – Address of the next instruction to execute.
✅ CPU Registers – Stores temporary data during execution.
✅ Memory Management Information – Stores memory-related details.
✅ I/O Information – Details about allocated input/output resources.
✅ Scheduling Information – Priority and scheduling queue details.