Compare the Difference Between Similar Terms

Difference Between

Home / Technology / IT / Operating System /Difference Between Preemptive and Nonpreemptive Scheduling in OS

Difference Between Preemptive and Nonpreemptive Scheduling in OS

February 19, 2018Posted byLithmee

Key Difference – Preemptivevs Nonpreemptive Scheduling in OS

A process is a program in execution. A computer should perform many tasks at the same time. Therefore, the CPU should get processes and execute them. Sometimes it is necessary to execute some processes than the other processes. At that point, the running process is interrupted, and CPU is allocated to the new process. After the task is completed, the CPU is allocated back to the previous process. The scheduling according to this mechanism is known as preemptive scheduling. If the running process, cannot be interrupted and it is compulsory to execute the running process, then it is known as nonpreemptive scheduling. This article discusses the difference between the preemptive and nonpreemptive scheduling in an operating system.The preemptive scheduling is the process scheduling mechanism through which a process that can be interrupted by another process in the middle of its execution. The nonpreemptive scheduling is the process scheduling mechanism through which one process starts execution only after the previous process terminates.That is thekey differencebetweenPreemptive and Nonpreemptive Scheduling in OS.

CONTENTS

1.Overview and Key Difference
2.What is Preemptive Scheduling in OS
3.What is Nonpreemptive Scheduling in OS
4.Similarities Between Preemptive and Nonpreemptive Scheduling in OS
5.Side by Side Comparison – Preemptive vs Nonpreemptive Scheduling in OS in Tabular Form
6.Summary

What is Preemptive Scheduling in OS?

Round Robin Scheduling is an example of preemptive scheduling. Each process gets a small amount of CPU time. It is usually 10 to 100 milliseconds. This small unit of data is also known as time quantum. After this time has elapsed, the process is preempted and added to the end of the ready queue. Assume that there are 4 processes as P1, P2, P3 and P4. The CPU burst times in milliseconds are as follows. The time quantum is 20.

Difference Between Preemptive and Nonpreemptive Scheduling in OS

Figure 01: Example of Round Robin Scheduling

The P1 process executes till 20. There is another 33ms left. Then the P2 executes. As the time quantum is 20 and the required time P2 is 17ms, P2 will execute for 17ms. So, the P2 process is completed. Then the chance is given to P3. It will execute for 20ms. The rest is 48ms. Then the P4 will execute for 20ms. It has 4ms to complete the total process. Again, the P1 will execute for 20ms. It has another 13ms to completing finish the process. The change is given to P3. It will execute for 20ms, and it has another 28ms to finish completely. The P4 executes. It only has 4ms. Therefore, P4 completes the execution. P2 and P4 have already finished. The remaining processes are P1 and P3. The chance is given to P3. It had 13ms to complete, so it completes. Now the only remaining process is P3. It has 28ms to complete. So P3 will run for 20ms. The rest is 8ms. All other processes have already completed executing. Therefore, again the rest of 8ms of P3 will execute. Likewise, each process gets a chance to execute.

What is Nonpreemptive Scheduling in OS?

First Come First Served (FCFS) scheduling can be taken as an example of nonpreemptive scheduling. The process that requests first is allocated to the CPU first. This scheduling is easily managed by the First In First Out (FIFO) queue. If there are processes came in order as P1, P2 and P3, then the chance is first given to P1. After it is completed, P2 will execute. When P2 completes, the P3 will execute. Assume that there are 3 processes as P1, P2 and P3 with CPU burst times in milliseconds as follows.

关键的先发制人和Nonpreemptiv之间的区别e Scheduling in OS

Figure 02: Example of FCFS Scheduling

According to the above, P1 will execute. Once it is completed, the process P2 is executed for 3ms. Now the remaining process is P3. Then it will execute. The waiting time for P1 is zero. The process P2 had to wait 24ms, and the process P3 had to wait 27ms. If the processes arrived in order P2, P3 and P1 then P2 will complete first. Next P3 will complete, and finally, P1 will complete.

What is the Similarity Between Preemptive and Nonpreemptive Scheduling in OS?

  • Both Preemptive and Nonpreemptive Scheduling in OS are mechanisms to schedule processes in a computer.

What is the Difference Between Preemptive and Nonpreemptive Scheduling in OS?

Preemptive vs Nonpreemtive Scheduling in OS

The preemptive scheduling is the process scheduling mechanism through which a process can be interrupted by another process in the middle of its execution. The nonpreemptive scheduling is the process scheduling mechanism through which one process starts execution only after the previous process terminates.
Process Interruption
In preemptive scheduling, the processes can be interrupted. In nonpreemptive scheduling, the processes can be interrupted.
CPU Utilization
In preemptive scheduling, the CPU utilization is higher than nonpreemptive scheduling. 无优先的调度,CPU利用率s minimum comparing to preemptive scheduling.
Flexibility
Preemptive scheduling is flexible. Nonpreemptive scheduling is not flexible.

Summary – Preemptivevs Nonpreemptive Scheduling in OS

There are multiple processes running on a computer. When each process executes, the CPU is allocated to that specific process. Sometimes, it is necessary to stop the execution of the current process and to give priority to another process. Processes scheduling mechanisms can be preemptive or nonpreemptive. The preemptive scheduling is the process scheduling mechanism through which process can be interrupted by another process in the middle of its execution. The nonpreemptive scheduling is the process scheduling mechanism though which one process starts execution only after the previous process terminates. This is the difference between Preemptive and Nonpreemptive Scheduling in OS.

Download the PDF of Preemptive vs Nonpreemptive Scheduling in OS

You can download the PDF version of this article and use it for offline purposes as per citation note. Please download the PDF version here:Difference Between Preemptive and Nonpreemptive Scheduling in OS

Reference:

1.What is pre-Emptive and non-Preemptive scheduling?.Available here
2.Point, Tutorials. “Operating System Scheduling algorithms.”,Tutorials Point. 8 Jan. 2018.Available here
3.“What are pre-Emptive and non-Preemptive terms in context of OS ?” GeeksforGeeks Q&A.Available here

Related posts:

Difference Between Windows 7 Professional and Windows 7 Ultimate Difference Between Android 2.1 (Eclair) and Android 2.3 (Gingerbread) Difference Between Symbian 3 and Android 2.2 Gingerbread Difference Between Leopard and Snow Leopard Difference Between Kernel and Operating System

Filed Under:Operating SystemTagged With:Compare Preemptive and Nonpreemptive Scheduling in OS,Nonpreemptive Scheduling in OS,Nonpreemptive Scheduling in OS Definition,Nonpreemptive Scheduling in OS Flexibility,Nonpreemptive Scheduling in OS Process,Nonpreemptive Scheduling in OS Utilization,Preemptive and Nonpreemptive Scheduling in OS Differences,Preemptive and Nonpreemptive Scheduling in OS Similarities,Preemptive Scheduling in OS,Preemptive Scheduling in OS Definition,Preemptive Scheduling in OS Flexibility,Preemptive Scheduling in OS Process,Preemptive Scheduling in OS Utilization,Preemptive vs Nonpreemptive Scheduling in OS

About the Author:Lithmee

Lithmee Mandula is a BEng (Hons) graduate in Computer Systems Engineering. She is currently pursuing a Master’s Degree in Computer Science. Her areas of interests in writing and research include programming, data science, and computer systems.

Leave a ReplyCancel reply

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

Request Article

Featured Posts

Difference Between Coronavirus and Cold Symptoms

Difference Between Coronavirus and Cold Symptoms

Difference Between Coronavirus and SARS

Difference Between Coronavirus and SARS

Difference Between Coronavirus and Influenza

Difference Between Coronavirus and Influenza

Difference Between Coronavirus and Covid 19

Difference Between Coronavirus and Covid 19

You May Like

Difference Between Dispersion and Scattering of Light

Difference Between Dispersion and Scattering of Light

Difference Between Pancreatic Cancer and Pancreatitis

Difference Between Sex Offender and Predator

Difference Between Profession and Occupation

Difference Between Reaction Rate and Reaction Time

Latest Posts

  • What is the Difference Between Molecular Formula and Structural Formula
  • What is the Difference Between Acne and Eczema
  • What is the Difference Between Mutation Rate and Substitution Rate
  • What is the Difference Between Vermicompost and Compost
  • What is the Difference Between Depression and Schizophrenia
  • What is the Difference Between Molecular Geometry and Electron Geometry
  • Home
  • Vacancies
  • About
  • Request Article
  • Contact Us

Copyright © 2010-2018Difference Between. All rights reserved.Terms of Useand Privacy Policy:Legal.