Day 02Part 02- Operating System for Computer Science – When we required CPU scheduling

Day 02Part 02- Operating System for Computer Science – When we required CPU scheduling



play-rounded-fill play-rounded-outline play-sharp-fill play-sharp-outline
pause-sharp-outline pause-sharp-fill pause-rounded-outline pause-rounded-fill
00:00

Here’s a clear explanation for “Day 02 Part 02 – Operating System (OS) for Computer Science: When We Require CPU Scheduling” — great for GATE, UGC NET, university exams, or general understanding.


Contents [hide]

📘 Topic: When Do We Require CPU Scheduling in an Operating System?


🧠 What Is CPU Scheduling?

CPU scheduling is the process of selecting one process from the ready queue and assigning the CPU to it.

The Operating System’s scheduler decides which process gets the CPU and when, based on scheduling algorithms (like FCFS, SJF, Round Robin, etc.).


🕒 When Is CPU Scheduling Required?

CPU scheduling is required only when the CPU becomes idle and needs to choose the next process to execute.

More specifically, CPU scheduling is needed in the following cases:


1. When a Process Switches from Running to Waiting

Example:

  • A process requests I/O → It leaves CPU
  • CPU is free → Scheduler picks another process from the ready queue.

✔️ Scheduling needed


2. When a Process Switches from Running to Ready

This happens in preemptive scheduling (like Round Robin or Priority Scheduling).
Example:

  • A process is running.
  • A higher-priority process arrives.
  • OS preempts current process and schedules the new one.

✔️ Scheduling needed


3. When a Process Switches from Waiting to Ready

Example:

  • A process finishes I/O.
  • Now it’s ready to execute again.

✔️ Scheduling may be needed if the CPU is idle or preemption is allowed.


4. When a Process Terminates

  • The running process completes.
  • CPU becomes idle.

✔️ Scheduling needed to assign CPU to the next process.


🚫 When It’s Not Required:

If only one process is running and no others are ready or waiting, no scheduling is needed.


🧪 Summary Table:

Event CPU Scheduling Required?
Running → Waiting ✔️ Yes
Running → Ready (Preemption) ✔️ Yes
Waiting → Ready ✔️ Yes (if CPU idle)
Process Termination ✔️ Yes
Only one process exists (no competition) ❌ No

🎯 Why It’s Important (in OS Exams or GATE):

  • Forms the basis for scheduling algorithm design.
  • Helps in understanding context switching, CPU utilization, and response time optimization.

If you’d like, I can give you:

  • 📄 A printable revision note (PDF)
  • 📊 Chart comparing different scheduling algorithms
  • 🎥 Script for explaining this in a short video format

Let me know how you’d like to study this!

Day 02Part 02- Operating System for Computer Science – When we required CPU scheduling

OPERATING SYSTEM Lecture Notes On

CPU Scheduling



Leave a Reply

Your email address will not be published. Required fields are marked *

error: