Operating System
Table of content:
- What Is An Operating System?
- What Is The Importance Of Operating Systems?
- What Are The Functions Of Operating System?
- Services Provided By Operating System
- Types Of Operating System
- Some Popular Operating Systems
- Conclusion
- Frequently Asked Questions
- Test Your Skills: Quiz Time
Table of content:
- What Is An Operating System?
- Types Of Operating Systems
- Batch OS | Types Of Operating Systems
- Multi-Programming OS | Types Of Operating Systems
- Multi-Processing OS | Types Of Operating Systems
- Multi-Tasking OS | Types Of Operating Systems
- Time-Sharing OS | Types Of Operating Systems
- Distributed OS | Types Of Operating Systems
- Network OS | Types Of Operating Systems
- Real-Time OS | Types Of Operating Systems
- Mobile OS | Types Of Operating Systems
- History Of Operating System
- Operating Systems in Business: Achieving Maximum Utilization
- Advantages & Disadvantages of Operating Systems
- Popular Operating Systems In The Market
- Conclusion
- Frequently Asked Questions
- Test Your Skills: Quiz Time
Table of content:
- What is a Process in Programming?
- What is Process Scheduling in OS?
- The Need for Process Scheduling in OS
- What is CPU Scheduling Algorithm?
- Different Types of CPU Scheduling Algorithms
- Conclusion
- Frequently Asked Questions
- Test Your Skills: Quiz Time
Table of content:
- Evolution & Generations Of Computers
- Definition Of A Computer System
- Components & Classification Of Computer Systems
- Basics Of Computer Networking & The Internet
- Introduction To Operating Systems
- Exploring Computer Memory & Storage
- Importance Of Computer Security & Privacy
- Applications Of Computer Fundamentals
- Job Prospects With Computer Fundamentals
- Frequently Asked Questions (FAQs)
- Master Your Skills: Quiz Time!
Table of content:
- Types of threads per process
- Introducing Thread Models
- What is Multithreading?
- Advantages of Multithreading
- Disadvantages of Multithreading
- Multithreading Models
- Multithreading Vs. Multitasking
- Difference between Process, Kernel Thread and User Thread
- Conclusion
- FAQs
- Test Your Skills: Quiz Time
Table of content:
- What is Booting Process?: Understanding the Types
- Steps in the Booting Process of Computer
- Boot Sequence in Operating System
- Booting Process: Evolution & Troubleshooting
- What is Secure Boot?
- What is Dual Booting?
- Conclusion
- Frequently Asked Questions
- Test Your Skills: Quiz Time
Table of content:
- What is A Counter?
- Difference Between Synchronous And Asynchronous Counters
- What is an Asynchronous Counter?
- What Is A Synchronous Counter?
- Conclusion
- Frequently Asked Questions
- Test Your Skills: Quiz Time
Table of content:
- History Of Mutex And Semaphore
- Difference Between Mutex And Semaphore
- What Is A Mutex?
- What Is A Semaphore?
- Common Facts About Mutex And Semaphore
- Conclusion
- Frequently Asked Questions
- Test Your Skills: Quiz Time
Table of content:
- What is a File?
- What is a Folder?
- Difference between File and Folder
- Summing Up
- Test Your Skills: Quiz Time
Table of content:
- Paging
- Advantages of Paging
- Disadvantages of Paging
- Segmentation
- Advantages of segmentation
- Disadvantages of segmentation
- Difference between Paging and Segmentation
- Conclusion
- FAQs
- Test Your Skills: Quiz Time
Table of content:
- Types of Fragmentation
- Internal Fragmentation
- External Fragmentation
- Difference between Internal and External Fragmentation
- Summing up
- Test Your Skills: Quiz Time
Table of content:
- What is Paging in OS?
- Characteristics of Paging in OS
- Paging in OS: Page Table
- Paging with TLB (Translation Look-aside Buffer)
- Advantages of Paging in OS
- Disadvantages of Paging in OS
- Summing Up
- Frequently Asked Questions
- Test your skills: Quiz Time
Table of content:
- What Is Starvation In OS?
- Starvation In OS: Common Causes
- What Is Deadlock?
- Difference Between Deadlock And Starvation in OS
- Solutions To Starvation In OS
- Conclusion
- Frequently Asked Questions
- Test Your Skills: Quiz Time
Table of content:
- Introduction to DOS: A brief history
- Introduction to Windows: A brief history
- Working of DOS
- Working of Windows
- Line of difference: DOS versus Windows
- Versions of DOS and Windows
- Summing Up
- Test Your Skills: Quiz Time
Table of content:
- Understanding File And Directory In OS
- The Directory Structure In OS
- Types Of Directory Structure In OS
- Directory Implementation In OS
- Conclusion
- Frequently Asked Questions
- Test Your Skills: Quiz Time
Table of content:
- What is the purpose of CPU scheduling?
- What is preemptive scheduling?
- What is a non-preemptive scheduling method?
- Comparison between preemptive and non-preemptive scheduling
- Basic differences between the preemptive and non-preemptive scheduling techniques
- Advantages of preemptive scheduling -
- Disadvantages of preemptive scheduling
- Advantages of non-preemptive scheduling -
- Disadvantages of non-preemptive scheduling
- Test Your Skills: Quiz Time
Table of content:
- What Is Multiprogramming?
- Advantages of Multiprogramming Operating System
- Disadvantages of Multiprogramming Operating System
- What Is Multitasking?
- Advantages of Multitasking Operating System
- Disadvantages of Multitasking Operating System
- Multiprogramming Vs Multitasking
- Frequently Asked Questions
- Test Your Skills: Quiz Time
Table of content:
- Character User Interface
- Advantages of CUI
- Disadvantages of CUI
- Graphical User Interface
- Advantages of GUI
- Disadvantages of GUI
- Major Differences Between CUI and GUI
- Summing Up
- Test Your Skills: Quiz Time
Difference Between Preemptive And Non-Preemptive Scheduling

CPU scheduling is a task that involves planning and arranging processes in various stages such as 'ready', 'waiting', and 'running'. It enables the operating system to assign a time period for CPU execution to each process, allowing it to pick which tasks to do and for how long. This scheduling of CPU can be done in two ways: preemptive and non-preemptive scheduling. In this article, we will take you through these two types of scheduling. Toward the end, we will discuss the difference between preemptive and non-preemptive scheduling.
What is the purpose of CPU scheduling?
I/O and CPU time are both used in a typical process. The time spent waiting for input and output in a unified programming system like MS-DOS is wasted, and the CPU is free during that time. One process can use the CPU while another waits for I/O in multiprogramming systems. Thus CPU scheduling the processor helps in multitasking.
What is preemptive scheduling?
When the CPU is idle, it is the role of the CPU scheduler to assign a task to it. The CPU scheduler chooses a process from the ready queue and assigns it to the CPU. If there is still CPU burst time left, the resources (CPU cycles) are assigned to the critical process for a short period and then removed, and the process is placed back in the ready queue. The process remains in the ready queue until it is given the opportunity to run again.
Preemptive Scheduling is the scheduling that occurs when a process transitions from a running state to a ready state or from a waiting state to a ready state. It is a style of scheduling in which jobs are largely assigned according to their priority.
When a high-priority process enters the ready queue, it is not required to wait for the current process to finish its burst period. Instead, the current process is paused in the middle of execution and placed in the ready queue until the high-priority process consumes all CPU cycles. As a result, each task in the ready queue gets some CPU time. It increases the overhead of transitioning the process from running to ready state and vice versa, but it makes preemptive scheduling more flexible.
Examples of preemptive scheduling algorithms
Some scheduling algorithms based on preemptive scheduling are-
- Round Robin (RR)
- Shortest Remaining Time First (SRTF)
- Priority (preemptive version)
What is a non-preemptive scheduling method?
Even though the lower-priority activity is still running, it is sometimes necessary to run a higher-priority task before a lower-priority task. The lower-priority work is put on hold for a while and resumes after the higher-priority activity is completed. The non-preemptive scheduling process is the type of scheduling that occurs when a process quits or shifts from executing to waiting for the state.
The CPU has been assigned to a certain process in this scheduling mechanism. The process that keeps the CPU occupied will either switch context or terminate to relieve the CPU. When a process voluntarily enters the wait state or terminates, this is known as non-preemptive scheduling.
If a process with a long CPU burst time is running under non-preemptive scheduling, it is not interrupted in the middle of execution and the other process will have to wait for a long period, increasing the average waiting time of the processes in the ready queue.
Examples of non-preemptive scheduling -
Some scheduling algorithms based on preemptive scheduling are-
- Shortest Job First (SJF, which is essentially non-preemptive)
- First-come-first-served
- Priority (non-preemptive version)
Comparison between preemptive and non-preemptive scheduling
Parameter | PREEMPTIVE SCHEDULING | NON-PREEMPTIVE SCHEDULING |
Meaning | For a limited time, resources (CPU Cycle) are allotted to a process. | Once resources (CPU Cycles) are allotted to a process, it is held until the burst time is completed or the process transitions to the waiting state. |
Interrupt | The process can be halted at any time. | The process can't be stopped until it finishes or its timer runs out. |
Starvation | A low-priority process may starve if a high-priority process often appears in the ready queue. | If a process with a long burst time consumes CPU, subsequent processes with shorter burst times may suffer. |
Overhead | It contains overheads of switching a process from running state to ready state | There are no overheads. |
Flexibility | Flexible | Rigid |
Cost | Cost associated | No cost associated |
CPU Utilization | CPU is overworked | CPU is less utilized |
Examples | Round Robin and Shortest Remaining Time First are two examples of preemptive scheduling. | First come, first served, and the quickest job gets done first. |
Time | Waiting and response time is lower |
Waiting and response time is higher |
Basic differences between the preemptive and non-preemptive scheduling techniques
Preemptive scheduling differs from non-preemptive scheduling in that the CPU is allotted to the processes for a set amount of time in preemptive scheduling. The CPU is allotted to the process in non-preemptive scheduling until it quits or changes to the waiting state.
Consequently, in preemptive scheduling, the execution process is interrupted in the middle, whereas in non-preemptive scheduling, the execution process is not stopped in the middle. Moreover, in preemptive scheduling, if a high-priority process repeatedly appears in the ready queue, the low-priority process will have to wait a long time and may have to starve. However, because vital processes are permitted to access the CPU when they arrive in the ready queue, regardless of what task is presently running, preemptive scheduling is extremely flexible.
In non-preemptive scheduling, on the other hand, if the CPU is allotted to the process with the longer burst time, the processes with the shorter burst time may be forced to starve. Non-preemptive scheduling is strict because even if a vital process joins the ready queue, the CPU of the executing process is not affected.
Let us now discuss the advantages and disadvantages of these scheduling techniques, starting with preemptive scheduling:
Advantages of preemptive scheduling -
- Preemptive scheduling is a more robust solution that prevents one process from monopolizing the CPU.
- After each interruption, the running job was reviewed.
- Each occurrence resulted in the disruption of ongoing tasks.
- The operating system ensures that all running processes use the same amount of CPU.
- The CPU consumption is the same in this case, i.e., all running programs will consume the same amount of CPU.
- The average response time is also improved by using this scheduling strategy.
- When used in a multi-programming environment, preemptive scheduling is advantageous.
Disadvantages of preemptive scheduling
The following are the disadvantages and drawbacks of the Preemptive Scheduling method:
- Scheduling necessitates the use of limited computational resources.
-
The scheduler spends more time suspending the ongoing job, switching the context, and dispatching the new incoming task.
-
If many high-priority processes arrive at the same time, the low-priority process will have to wait longer.
These are the advantages and disadvantages of non-preemptive scheduling:
Advantages of non-preemptive scheduling -
- Low overhead in terms of scheduling
- It has a tendency to have a high throughput.
- It is a fairly basic strategy in terms of principle.
- Scheduling requires fewer computing resources.
Disadvantages of non-preemptive scheduling
- It can lead to famine, especially for those jobs that require immediate attention.
- Bugs can cause a system to become unresponsive.
- It has the ability to make real-time and priority decisions. Scheduling is a challenge.
- Process reaction time is too slow.
Test Your Skills: Quiz Time
You might also be interested in reading:
I am a lifelong student of languages, English being the pet favorite, exploring my creative side through content writing. I also like to boogie. When I am not reading, binge-watching, and dancing, you can spot me doing pspspspspss to cats and dogs on the streets.
Comments
Add commentLogin to continue reading
And access exclusive content, personalized recommendations, and career-boosting opportunities.

Subscribe
to our newsletter
Blogs you need to hog!

This Is My First Hackathon, How Should I Prepare? (Tips & Hackathon Questions Inside)

10 Best C++ IDEs That Developers Mention The Most!

Advantages and Disadvantages of Cloud Computing that you should know!

Sai Srihitha Mallela 3 weeks ago
Sidratul Zuha Mohammad 3 weeks ago
Madala Jeswitha durga 3 weeks ago
Aswathi P 3 weeks ago
Vishwajeet Singh 3 weeks ago
Sanchit Dhale 3 weeks ago