Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Notes  >  Operating System  >  Introduction to Preemptive & Non-Preemptive Scheduling

Introduction to Preemptive & Non-Preemptive Scheduling | Operating System - Computer Science Engineering (CSE) PDF Download

Preemptive and Non-Preemptive Scheduling

  1. Preemptive Scheduling
    Preemptive scheduling is used when a process switches from running state to ready state or from waiting state to ready state. The resources (mainly CPU cycles) are allocated to the process for the limited amount of time and then is taken away, and the process is again placed back in the ready queue if that process still has CPU burst time remaining. That process stays in ready queue till it gets next chance to execute. Algorithms based on preemptive scheduling are: Round Robin (RR),Shortest Remaining Time First (SRTF), Priority (preemptive version), etc.
    Introduction to Preemptive & Non-Preemptive Scheduling | Operating System - Computer Science Engineering (CSE)
  2. Non-Preemptive Scheduling
    Non-preemptive Scheduling is used when a process terminates, or a process switches from running to waiting state. In this scheduling, once the resources (CPU cycles) is allocated to a process, the process holds the CPU till it gets terminated or it reaches a waiting state. In case of non-preemptive scheduling does not interrupt a process running CPU in middle of the execution. Instead, it waits till the process complete its CPU burst time and then it can allocate the CPU to another process.
    Algorithms based on non-preemptive scheduling are: Shortest Job First (SJF basically non preemptive) and Priority (non preemptive version), etc.
    Introduction to Preemptive & Non-Preemptive Scheduling | Operating System - Computer Science Engineering (CSE)

Key Differences Between Preemptive and Non-Preemptive Scheduling

  1. In preemptive scheduling the CPU is allocated to the processes for the limited time whereas in Non-preemptive scheduling, the CPU is allocated to the process till it terminates or switches to waiting state.
  2. The executing process in preemptive scheduling is interrupted in the middle of execution when higher priority one comes whereas, the executing process in non-preemptive scheduling is not interrupted in the middle of execution and wait till its execution.
  3. In Preemptive Scheduling, there is the overhead of switching the process from ready state to running state, vise-verse, and maintaining the ready queue. Whereas in case of non-preemptive scheduling has no overhead of switching the process from running state to ready state.
  4. In preemptive scheduling, if a high priority process frequently arrives in the ready queue then the process with low priority has to wait for a long, and it may have to starve. On the other hands, in the non-preemptive scheduling, if CPU is allocated to the process having larger burst time then the processes with small burst time may have to starve.
  5. Preemptive scheduling attain flexible by allowing the critical processes to access CPU as they arrive into the ready queue, no matter what process is executing currently. Non-preemptive scheduling is called rigid as even if a critical process enters the ready queue the process running CPU is not disturbed.
  6. The Preemptive Scheduling has to maintain the integrity of shared data that’s why it is cost associative as it which is not the case with Non-preemptive Scheduling.

Comparison Chart  
Introduction to Preemptive & Non-Preemptive Scheduling | Operating System - Computer Science Engineering (CSE)

The document Introduction to Preemptive & Non-Preemptive Scheduling | Operating System - Computer Science Engineering (CSE) is a part of the Computer Science Engineering (CSE) Course Operating System.
All you need of Computer Science Engineering (CSE) at this link: Computer Science Engineering (CSE)
10 videos|99 docs|33 tests

Top Courses for Computer Science Engineering (CSE)

FAQs on Introduction to Preemptive & Non-Preemptive Scheduling - Operating System - Computer Science Engineering (CSE)

1. What is preemptive scheduling?
Ans. Preemptive scheduling is a type of scheduling algorithm in which a process can be interrupted and moved out of the CPU before its time slice is completed. This means that higher priority processes can be given the CPU even if a lower priority process is currently running. The operating system decides when to preempt a process based on the priority of the processes and their time requirements.
2. What is non-preemptive scheduling?
Ans. Non-preemptive scheduling is a type of scheduling algorithm in which a process cannot be interrupted and moved out of the CPU until it completes its time slice or voluntarily yields the CPU. In this type of scheduling, once a process starts executing, it continues until it finishes or gives up control of the CPU. The operating system does not forcibly preempt the process.
3. What are the advantages of preemptive scheduling?
Ans. Preemptive scheduling allows for better utilization of the CPU as higher priority processes can be given immediate access to the CPU. It also ensures that time-critical processes are executed in a timely manner, preventing delays in their execution. Additionally, preemptive scheduling enables multitasking, where multiple processes can run concurrently, improving overall system performance.
4. What are the advantages of non-preemptive scheduling?
Ans. Non-preemptive scheduling avoids the overhead of context switching, which occurs when the CPU switches between different processes. This can result in better efficiency and reduced system overhead. It also simplifies the design and implementation of the scheduling algorithm as the operating system does not need to constantly monitor and preempt processes.
5. Which scheduling algorithm is more commonly used in real-time systems?
Ans. Preemptive scheduling is more commonly used in real-time systems. Real-time systems require strict timing guarantees and the ability to handle time-critical tasks. Preemptive scheduling allows for better control over the execution of processes and ensures that time-critical tasks are given immediate attention, making it suitable for real-time applications.
10 videos|99 docs|33 tests
Download as PDF
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev
Related Searches

Exam

,

past year papers

,

Introduction to Preemptive & Non-Preemptive Scheduling | Operating System - Computer Science Engineering (CSE)

,

shortcuts and tricks

,

practice quizzes

,

mock tests for examination

,

Sample Paper

,

study material

,

Viva Questions

,

Objective type Questions

,

video lectures

,

Summary

,

Free

,

Previous Year Questions with Solutions

,

Introduction to Preemptive & Non-Preemptive Scheduling | Operating System - Computer Science Engineering (CSE)

,

Important questions

,

MCQs

,

Introduction to Preemptive & Non-Preemptive Scheduling | Operating System - Computer Science Engineering (CSE)

,

Extra Questions

,

Semester Notes

,

pdf

,

ppt

;