Day 01Part 01- Operating System for gate Computer Science โ Introduction to scheduling algorithm.
Hereโs a clear and structured explanation for:
Contents
- 1 Day 01 โ Part 01: Operating System for GATE CSE
- 1.1 Topic: Introduction to Scheduling Algorithms
- 1.2 1. What is CPU Scheduling?
- 1.3 Why Scheduling is Important in OS (GATE Point of View):
- 1.4 2. Types of Schedulers in OS:
- 1.5 3. Scheduling Criteria (Very Important for GATE MCQs)
- 1.6 4. Classification of Scheduling Algorithms
- 1.7 5. Brief Intro to Common Scheduling Algorithms
- 1.8 GATE Question Examples
- 1.9 Formula Quick Recap
- 1.10 Recommended for GATE CSE Preparation
- 1.11 Day 01Part 01- Operating System for gate Computer Science โ Introduction to scheduling algorithm.
- 1.12 OPERATING SYSTEMS Unit โ I 1.1 Introduction
Day 01 โ Part 01: Operating System for GATE CSE
Topic: Introduction to Scheduling Algorithms
1. What is CPU Scheduling?
CPU Scheduling is the process of selecting one process from the ready queue to execute next on the CPU.
In a multiprogramming system, multiple processes are in memory, and the CPU scheduler picks one of the processes to run.
Why Scheduling is Important in OS (GATE Point of View):
-
Improves CPU utilization
-
Minimizes waiting time, turnaround time
-
Maximizes throughput and responsiveness
2. Types of Schedulers in OS:
| Scheduler Type | Role |
|---|---|
| Long-Term | Decides which jobs are admitted to the system |
| Short-Term | Picks from ready queue โ allocated to CPU (CPU Scheduling) |
| Medium-Term | Suspends/resumes processes (used for swapping) |
3. Scheduling Criteria (Very Important for GATE MCQs)
| Criterion | Description |
|---|---|
| CPU Utilization | Keep CPU as busy as possible (ideal: 100%) |
| Throughput | No. of processes completed per unit time |
| Turnaround Time | Completion time โ Arrival time |
| Waiting Time | Turnaround Time โ Burst Time |
| Response Time | First response โ Arrival time |
| Fairness | No starvation, all processes get chance |
4. Classification of Scheduling Algorithms
| Type | Examples |
|---|---|
| Non-Preemptive | FCFS, SJF (non-preemptive), Priority (non-preemptive) |
| Preemptive | SRTF, Round Robin, Priority (preemptive), Multilevel Queue |
5. Brief Intro to Common Scheduling Algorithms
| Algorithm | Key Idea |
|---|---|
| FCFS | First Come First Serve โ easy but can cause convoy effect |
| SJF | Shortest Job First โ optimal avg. waiting time, may cause starvation |
| SRTF | Preemptive version of SJF |
| Priority | Processes scheduled based on priority |
| Round Robin | Each process gets a time quantum โ good for time-sharing systems |
GATE Question Examples
Q (GATE 2017):
Which of the following scheduling algorithms could result in starvation?
Answer: SJF (non-preemptive) and Priority (if lower priority never gets CPU)
Formula Quick Recap
-
Turnaround Time (TAT) = Completion Time โ Arrival Time
-
Waiting Time = TAT โ Burst Time
-
Response Time = First Response โ Arrival Time
Recommended for GATE CSE Preparation
-
Practice 10โ15 scheduling problems with Gantt charts
-
Focus on edge cases (e.g., same arrival time, preemption mid-process)
-
Learn to compute average waiting and turnaround time
Would you like:
-
Gantt Chart problems with solutions? -
Video script/slide for this lesson? -
Quiz on these concepts?
Let me know and Iโll prepare it!