Process Management in Operating Systems: Complete Guide (2025)
Process Management is one of the core functions of an Operating System (OS). It deals with creating, scheduling, and terminating processes efficiently so that system resources (CPU, memory, I/O) are used effectively.
In aptitude tests, competitive exams, and technical interviews, questions on Process Management are frequently asked. This guide covers concepts, examples, solved problems, MCQs, and FAQs.
What is a Process?
- A Process is a program in execution.
- It consists of program code, data, and process control information.
- Each process is identified by a Process ID (PID).
Example: When you open a browser, it becomes a process managed by the OS.
Process States
A process moves through several states during execution:
- New – Process is created.
- Ready – Waiting to be assigned to CPU.
- Running – Currently executing on CPU.
- Waiting/Blocked – Waiting for I/O or event.
- Terminated – Execution finished.
Process Control Block (PCB)
Each process has a PCB, which stores:
- Process ID
- Program Counter
- CPU registers
- Process state
- Scheduling info
- Memory info
Process Scheduling
The OS uses schedulers to decide which process runs next.
- Long-Term Scheduling – Decides which jobs enter the system.
- Medium-Term Scheduling – Temporarily suspends/resumes processes.
- Short-Term Scheduling – Selects which process runs on CPU.
Scheduling Algorithms:
- First Come First Serve (FCFS)
- Shortest Job Next (SJN)
- Round Robin (RR)
- Priority Scheduling
- Multilevel Queue
Context Switching
- The process of saving the current state of a process and loading another process is called context switching.
- Happens during process preemption or I/O wait.
Solved Examples
Example 1:
In Round Robin scheduling, if time quantum = 4 ms and 3 processes require 8, 6, and 4 ms respectively, how many CPU cycles are needed?
Answer: Each process gets CPU in cycles; total 6 cycles.
Example 2:
If 3 jobs arrive at the same time with burst times 5, 8, and 10, which algorithm gives minimum average waiting time?
Answer: Shortest Job Next (SJN).
MCQ Practice
Which data structure is used in Round Robin scheduling?
(a) Queue
(b) Stack
(c) Linked List
(d) TreeWhich scheduling algorithm may cause starvation?
(a) FCFS
(b) Priority Scheduling
(c) Round Robin
(d) Multilevel QueueContext Switching involves:
(a) Changing process state
(b) Saving CPU state
(c) Loading new process info
(d) All of the aboveWhich of the following is NOT a process state?
(a) Ready
(b) Running
(c) Terminated
(d) Compiled
Tips to Master Process Management
- Learn process states & transitions thoroughly.
- Revise PCB structure for theory questions.
- Solve scheduling algorithm problems (Gantt charts).
- Practice numerical questions on waiting time, turnaround time.
- Understand context switching clearly.
FAQs:
Q1. What is the difference between a process and a program?
A program is passive (code on disk), a process is active (code in execution).
Q2. Why is scheduling needed in OS?
To maximize CPU utilization, fairness, and reduce waiting time.
Q3. What is starvation?
A process never gets CPU due to low priority.
Q4. What is the difference between Preemptive and Non-Preemptive Scheduling?
Preemptive allows interrupting a running process, non-preemptive does not.