Operating Systems 2026 —
Process, Scheduling, Deadlocks & Memory
Process vs Thread, CPU scheduling algorithms, all 4 deadlock conditions, Banker’s Algorithm, paging, and virtual memory — complete GATE CSE guide.
Operating Systems (OS) is the software layer between hardware and user applications — it manages processes, memory, files, and devices. It is one of the highest-weightage GATE CSE subjects at 6–10 marks, and a standard topic in all placement technical interviews. Galvin’s OS Concepts (Silberschatz) is the gold-standard reference book for this subject.
1. What is an Operating System?
An Operating System is system software that acts as an intermediary between computer hardware and application programs. It manages the computer’s hardware resources and provides common services for programs. Without an OS, every application would need to directly manage hardware — an impossible task.
Key OS functions: Process management, memory management, file system management, I/O management, and security. Popular OS examples: Linux, Windows, macOS, Android.
2. Process vs Thread — Critical Difference
This is one of the most-asked topics in both GATE and placement interviews.
| Feature | Process | Thread |
|---|---|---|
| Definition | Program in execution — independent entity | Lightweight unit within a process |
| Memory | Own address space | Shares process memory |
| Resources | Own file handles, I/O, PCB | Shares process resources |
| Context switch | Expensive — save/restore full state | Fast — less state to save |
| Communication | IPC needed (pipes, sockets, shared memory) | Direct via shared memory |
| Isolation | Crash isolated to process | One thread crash can kill process |
| Creation overhead | Heavy | Light |
3. Process States & PCB
A process goes through 5 states during its lifetime. The OS tracks each process using a data structure called the Process Control Block (PCB).
PROCESS STATE DIAGRAM:
[New] ──────create──────→ [Ready] ←──────────────────┐
| |
dispatch preempt
| |
↓ |
[Running] ──I/O request──→ [Waiting]
| |
terminate I/O done
| |
↓ |
[Terminated] → [Ready] ←──┘
PCB contains: PID, State, Program Counter, CPU Registers,
CPU Scheduling info, Memory management info,
I/O status, Accounting information
4. CPU Scheduling Algorithms
CPU scheduling decides which process gets the CPU next. Key metrics: Turnaround Time (TAT) = Completion − Arrival, Waiting Time (WT) = TAT − Burst Time, Response Time = First response − Arrival.
FCFS
First Come First Served
SJF
Shortest Job First
SRTF
Shortest Remaining Time
Round Robin
Time Quantum Based
Priority
Highest Priority First
🎯 GATE Tip — CPU Scheduling Calculations
GATE numerical questions on scheduling are very common. Practice computing Gantt charts, TAT, WT, and average WT for FCFS, SJF, SRTF, and Round Robin. SRTF (preemptive SJF) is the hardest and most frequently tested. Draw the Gantt chart step-by-step — never skip this in GATE.
5. Process Synchronization
When multiple processes share resources, race conditions can cause incorrect results. Synchronization ensures only one process accesses a critical section at a time.
A Critical Section is the code that accesses shared data. A good solution must satisfy: (1) Mutual Exclusion — only one process in CS at a time. (2) Progress — if no one is in CS, any process can enter. (3) Bounded Waiting — a process cannot wait forever.
6. Deadlocks — The 4 Necessary Conditions
A deadlock is a state where two or more processes are permanently blocked, each waiting for a resource held by another. ALL four Coffman conditions must hold simultaneously for a deadlock to occur — eliminate any one, and deadlock cannot happen.
7. Banker’s Algorithm — Deadlock Avoidance
The Banker’s Algorithm (by Dijkstra) is a deadlock avoidance algorithm. Before granting a resource request, the OS simulates the allocation and checks if the resulting state is safe — meaning all processes can still complete by executing in some order (a safe sequence). If safe, grant it; if not, make the process wait.
Banker's Algorithm — Safety Check:
Given: Allocation, Max, Available matrices
Need[i][j] = Max[i][j] - Allocation[i][j]
Safety Algorithm:
1. Work = Available; Finish[i] = false for all i
2. Find process i where: Finish[i]=false AND Need[i] ≤ Work
3. If found: Work = Work + Allocation[i]; Finish[i] = true; goto 2
4. If all Finish[i]=true → SAFE STATE (safe sequence found)
Else → UNSAFE STATE (potential deadlock)
🎯 GATE Tip — Banker’s Algorithm
Banker’s Algorithm problems are a GATE staple. Given Allocation, Max, and Available matrices, find the safe sequence. Practice this until you can do it in under 5 minutes — it appears almost every year and can be 2 marks for a correctly traced sequence.
Key: Compute Need = Max − Allocation first.
8. Memory Management — Paging & Segmentation
Paging divides logical memory into fixed-size pages and physical memory into frames of the same size. The OS maintains a page table to map logical page numbers to physical frame numbers. Paging eliminates external fragmentation but can cause internal fragmentation.
| Concept | Paging | Segmentation |
|---|---|---|
| Division | Fixed-size pages | Variable-size segments (code, data, stack) |
| Fragmentation | Internal only | External only |
| User visibility | Not visible | Visible to programmer |
| Address | Page number + offset | Segment number + offset |
| Protection | Per-page bits | Per-segment (read/write/execute) |
9. Virtual Memory & Page Replacement Algorithms
Virtual Memory allows processes to use more memory than physically available, by storing pages on disk (swap space) and loading them on demand. When a referenced page is not in memory, a page fault occurs and the OS loads it from disk.
Page replacement algorithms decide which page to evict when memory is full:
| Algorithm | How it works | Practical? | Page Faults |
|---|---|---|---|
| FIFO | Evict the oldest page in memory | Yes | Most faults (Belady’s anomaly) |
| LRU | Evict the Least Recently Used page | Costly to implement | Fewer than FIFO |
| Optimal | Evict the page not needed for longest time | Not practical (future unknown) | Minimum possible |
10. Frequently Asked Questions
🎓 Continue Your GATE CSE Preparation
Read our complete GATE CSE 2026 guide covering all 11 subjects with strategy and resources.
GATE CSE Full Guide →