Non preemptive scheduling – Solved Gate%20 Question Papers

Non preemptive scheduling – Solved Gate%20 Question Papers

Absolutely! Here’s a complete breakdown of Non-Preemptive Scheduling with a solved GATE-style question, including explanation, table, and Gantt chart — tailored for GATE CSE/IT aspirants.


Contents

🎯 Topic: Non-Preemptive Scheduling

Subject: Operating System
GATE Relevance: High
Type: Numerical-based Questions (Process Scheduling)


📘 What is Non-Preemptive Scheduling?

In Non-Preemptive Scheduling, once a process starts executing on the CPU, it cannot be stopped until it completes.
✅ The CPU is assigned only after the current process finishes.
This contrasts with Preemptive scheduling, where the CPU can be taken away by a higher-priority task.


✅ Common Non-Preemptive Scheduling Algorithms:

Algorithm Description
FCFS (First Come First Serve) Processed in order of arrival
SJF (Shortest Job First) Process with shortest burst time first
Priority Scheduling (Non-preemptive) Highest priority (lowest number) runs first

📝 Solved GATE-Style Question: SJF (Non-Preemptive)

📌 Question:
Consider the following processes:

Process Arrival Time Burst Time
P1 0 ms 8 ms
P2 1 ms 4 ms
P3 2 ms 9 ms
P4 3 ms 5 ms

Use Non-Preemptive SJF Scheduling.
Find the Average Waiting Time and Average Turnaround Time.


🧮 Step 1: Gantt Chart (SJF – Shortest Job First)

Initial time = 0, only P1 has arrived ⇒ Execute P1
At time 8, P2, P3, P4 have arrived
Shortest burst time among them = P2 (4ms)
Next = P4 (5ms)
Then = P3 (9ms)

📊 Gantt Chart:

| P1 | P2 | P4 | P3 |
0 8 12 17 26

📋 Step 2: Calculate Completion, Turnaround, and Waiting Times

Process Arrival Time Burst Time Completion Time Turnaround Time (CT – AT) Waiting Time (TAT – BT)
P1 0 8 8 8 0
P2 1 4 12 11 7
P3 2 9 26 24 15
P4 3 5 17 14 9

🧠 Final Answers:

  • Average Waiting Time = (0 + 7 + 15 + 9) / 4 = 7.75 ms

  • Average Turnaround Time = (8 + 11 + 24 + 14) / 4 = 14.25 ms


📦 Summary:

Metric Value
Avg Waiting Time 7.75 ms
Avg Turnaround Time 14.25 ms

💡 Key Concepts to Remember:

  • In Non-preemptive SJF, CPU waits for a process to finish before giving it to the next.

  • Always update available processes at each CPU idle time.

  • For equal burst times, use arrival time as tie-breaker.


📘 Want more GATE previous year solved papers for OS scheduling?
I can generate a full PDF set, practice quizzes, or custom short tricks — just let me know what format you prefer!

Non preemptive scheduling – Solved Gate%20 Question Papers

Operating System Sl.No. Name of the Topic 1. Process …

Leave a Reply

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

error: