While learning operating systems in CS, we came across a set of important topics. However, among them, “Process Scheduling In OS” is the most useful fundamental yet important topic on which the complete Operating Systems Subject is based.
All kinds of Modern Operating Systems can work on Multiple Processes at the same time by sharing the resources, although they have a single Central Processing Unit (CPU). This is done with the help of Process Scheduling which is very important to understand.
Due to the challenging behaviour and complex concepts students often seek Operating System Assignment Help from our experts.
In this article, we will first talk about the Process Scheduling. Later, we will discuss its different States, Queues, Algorithms, Real-world Case Studies, etc. So, let us start our discussion.
Summary Or Key Highlights:
Process Scheduling helps to figure out which process should be executed in the CPU and how.
There are Five States in Process Scheduling New, Ready, Running, Waiting, and End.
We will get Three Queues in Process Scheduling Job Queue, Ready Queue, and Waiting Queue.
The Five Schedulers are the backbone of the Process Scheduling Mechanism.
All the Schedulers are operated with the help of Scheduling Algorithms.
What Is Operating System Process Scheduling?
An Operating System needs to work on the Multiple Processes. Each Running Process execution will consume CPU, Memory Storage, and Time to complete. Once a process is completed, it will be removed and another process will be assigned to the CPU by the Process Manager.
However, in the case of Multiprogramming Operating Systems, at the same time, One or More Processes get assigned to the CPU. In that case, the Process Scheduling intervenes and Shares CPU Resources among processes to get completed simultaneously.
When Two or More Processes get executed in the CPU simultaneously using different strategies, it is known as Process Scheduling.
Historical Evolution Of Process Scheduling:
1950s: It was the Batch Processing Era when the First Come, First Serve Algorithm only worked.
1960s: Round Robin Technology was involved which helps to Share CPU Resources.
1970s: OSes started Multiprogramming as Priority Scheduling was introduced.
1980s: Real-time Systems were introduced with Rate Monotonic Scheduling (RMS) and Earliest Deadline First (EDF) Algorithms.
2010s: Completely Fair Scheduling (CFS) was introduced to make OS more Modern.
What Are Different Types Of States In Process Scheduling?
We hope that the Definition of CPU Scheduling has become clear to you. Now, there are Different States that help to work on One or More Processes at the same time in Scheduling.
These States are just like Process Control Block or Rooms where the Process Manager can Store and Retrieve processes as per the needs. Let us check all the 5 States one by one.
New State: When a New Process is created it will be stored in the New State. It will directly go inside the Ready State.
Ready State: When the Process becomes Ready to Execute in the CPU, it will be in the Ready State. When the CPU becomes Free, it will get the CPU Allocation & move to the Running State.
Running State: Every Process that is Currently Executed by the CPU will be inside this state.
Waiting State: If the Running Processes need some I/O Operation, then it will come inside the Waiting State. All the other processes will be inside the Running State. After getting the I/O Operation, the process will again come to the Ready State for further execution.
End State: When the Execution of the Process is Completed, it will come to the End or Terminated State.
What Are Different Process Scheduling Queues?
For Multiprogramming Operating Systems, in the States, One or More Processes can be stored. Now, the Process Scheduling Queues can manage the Multiple Processes stored in States.
Here, we will have Three Different Types Of Queues. Let us check the following list. This will help to know more about such Scheduling Queues.
Job Queue: The Job Queue can be seen in the New State. If Two Or More New Processes are introduced in the CPU, they will be stored in the New State and Form the Job Queue.
Ready Queue: The Ready Queue can be seen in the Ready State. If Multiple Processes get ready for CPU Allocation, they will form the Ready Queue.
Waiting Queue: The Waiting Queue can be seen in the Waiting State. If Two or More Processes are waiting for I/O Operation, they will form the Waiting Queue in the Waiting State.
What Are Different Process Schedulers In Operating System?
Process Schedulers are the applications that help in Process Transition across different states. If a Process needs to be transferred to the Ready State from the New State or the Ready To Running State, all is done with the help of the Process Schedulers.
There are Five Important Process Schedulers present in the Operating System. Let us check all of them one by one.
1. Long Term Scheduler (Job Scheduler):
The Long Term Scheduler is often termed as the Job Scheduler as well. This is because the Long Term Scheduler determines which process should be Introduced for Execution. Also, the Long Term Scheduler is responsible for the Transition of Processes from New to Ready State.
Features Of Long Term Scheduler:
The Long Term Scheduler helps to increase the Degree of Multiprogramming.
The Long Term Scheduler helps to Balance the System.
The Long Term Scheduler Doesn’t Operate Frequently.
2. Short Term Scheduler (CPU Scheduler):
After the Long Term Scheduler, it is time for the Short Term Scheduler. The Short Term Scheduler also known as the CPU Scheduler helps Processes Transition from Ready to Running State. As the Short Term Scheduler introduces processes to the CPU, it is known as CPU Scheduler.
Features Of Short Term Scheduler:
The Short Term Scheduler helps to Decide the Next Process.
The Short Term Scheduler operates in Every Millisecond.
The Short Term Scheduler uses FCFS, Round Robin, and Priority Scheduling Algorithms.
3. Medium Term Scheduler:
The Medium Term Scheduler is another important Process Scheduler. The Medium Term Scheduler helps the Process Transition between the Main Memory and Disk. In simple words, the Medium Term Scheduler helps the Process to transition between Running and Waiting States.
Features Of Medium Term Scheduler:
The Medium Term Scheduler Balance Memory Usage to Get Optimal Result.
Swapping In And Out is handled by the Medium Term Scheduler.
To do Efficient Resource Management, the Medium Term Scheduler is necessary.
4. Real-Time Process Scheduler:
The Real-Time Scheduler is not highly used like the above-discussed three Process Schedulers. The Real-Time Scheduler works with the Time Constraint. The Real-Time Scheduler can give Priority to a task based on the Time Constraint given to it. It can Transit Process from Ready To Running.
Features Of Real-Time Scheduler:
To Make Real-time Systems, the Real-Time Scheduler is useful.
The approach to tasks can be Hard and Soft based on Time Constraints.
The Real-Time Scheduler Ensures the Timely Execution of the tasks.
5. Fair-Share Scheduler:
If anybody is trying to make a Multi-user System, then the Fair-Share Scheduler or Completely Fair Scheduler should be used. The Fair-Share Scheduler ensures that CPU Resources should be Equally Divided across the process irrespective of their Size, Priority, and Type.
Features Of Fair Scheduler:
The Fair-Share Scheduler is useful for Shared Environments.
We can’t Customize the CPU Time in the Fair-Share Scheduler.
The Fair-Share Scheduler ensures the Fair-Allocation of Resources.
Comparison Table On Different Process Schedulers:
Here, we will make one Comparison Table on Different Process Schedulers. In this Comparison Table, we will see how Process Schedulers are different from each other in terms of Frequency, Operation Field, Impact, and Response Time.
So, let us check the following table to have a better understanding of Different Process Schedulers.
Category | Long Term Scheduler | Short Term Scheduler | Medium Term Scheduler | Real-Time Scheduler | Fair-Share Scheduler |
|---|---|---|---|---|---|
Frequency | Rare | Very Frequent | Medium | Timely (Strict/Soft) | Depends on System Load |
Operation Field | Process Admission | Ready State | Memory and Disk | Critical Task | Process Groups |
Impact | Low | High | Moderate | Low | Moderate |
Response Time | Indirect | High | Low | High | Moderate |
What Are Different Types Of Scheduling Algorithms?
Now the Process Schedulers can’t work as per their wish. The Process Schedulers also need to follow some Rules or Methods. These rules are known as the Scheduling Algorithm.
The Scheduler can work with Any Scheduling Algorithm. Based on the Algorithm, the working process can be changed slightly. There are Two Kinds of Scheduling Algorithms. Let us check them.
1. Preemptive Scheduling Algorithm:
These are the Scheduling Algorithms which can Interrupt the Processes after their Execution as well. When the Process is in a Running State, if needed, it can be directly converted to the Ready State to give another process space for various reasons like Priority, Time, etc.
The Algorithms that follow such types of concepts are the following. Let us check about them.
Round Robin Scheduling Algorithm: In the RR Scheduling Algorithm, a particular Time has been given for every process. Once, the Time is Completed, the Process will come to the Ready State again and other processes will start working.
Preemptive Priority Scheduling: The Preemptive Priority Algorithm provides Priority to Different Processes. The Process that has the Higher Priority will be executed First. While executing, if any New Process comes with Higher Priority, then that will be Executed.
Shortest Remaining Time First (SRTF): For many reasons, any Process can execute half and come to the Ready State from Running. In Ready Queue, if any Process has the Shortest Remaining Time to Complete will execute first in the SRTF Algorithm.
2. Non-Preemptive Scheduling Algorithm:
The Non-Preemptive Scheduling Algorithm is the complete Opposite. Here, if any process is Currently Executing, then any algorithm Doesn’t Have the Power to Interrupt It. Once, the process is completed, then the algorithm can work with that process. Such algorithms are very old.
We have made a list of algorithms that follow such types of concepts. Let us check about them.
Shortest Job First (SJF): The Processes in the Ready State which has the Less Brust Time will be executed first. We can see very much less use of the SJF Algorithm.
First Come, First Served (FCFS): In the FSFC Algorithm, the processes are executed in their Arriving Sequence. The Process that arrived first will be executed first. This sequence Can’t be Changed.
Non-Preemptive Priority Scheduling: In the Non-Preemptive Priority Scheduling, the Process which has the Greater Priority will be executed First. However, appearing any New Greater Priority will not harm the Ongoing Execution.
Real-World Case Studies On Process Scheduling:
Now, before we end our discussion, we would like to shed some light on the Real-world Case Studies of Process Scheduling. To understand Real-world Case Studies properly, we will take some Famous Worldwide Operating Systems as the example. Let us check the following list.
In this list, we will let you know how Famous Operating Systems are using Scheduling in their applications.
Windows OS: In Windows OS, we will get the Hybrid Scheduling Algorithm which mixes two or more Types of Algorithms. Here, the Normal Processes have the Priority from 0 to 15. And Real-time Tasks have the priority from 16 to 31.
Linux OS: In Linux and its Distributions, we can see the extensive use of the Completely Fair Scheduler (CFS) Algorithm. That is the reason, it allocates the CPU Time, based on the Size of the Processes.
MacOS: In MacOS, we will find the Mach Kernel. With the Mach Kernel, the Priority-based Scheduler will go best. That is the reason, in MacOS, the Priority Processes get executed first.
What Are Some Challenges Of Process Scheduling?
In Operating System Scheduling, everything is not Good. While working with Process Scheduling, we will surely come across different kinds of Challenges.
That is the reason, we have to know about them as well. Let us check the following list to know more.
Starvation: One of the Great Problems is the Starvation. The Process that has a Low Priority might face Infinite Delays if higher-priority processes continue to Dominate. That is the reason, we have to provide the Priorities carefully.
Deadlock: If the Scheduling is not done well, it might be a case that the process needs to wait for Infinite Times to get the Free Resources. That is the reason, we have to define the processes correctly.
CPU Overhead: Another big issue will be the CPU Overhead. If we are doing Frequent Context Switching, then such kind of problem will become common. So, we have to Switch the Context whenever it is very Much Needed.
Unbalanced Scheduling: While working with Operating Systems, we have to keep in mind that Scheduling should not go below a Certain Level. In that case, the CPU will face Idleness which is not good at all.
Conclusion:
In the end, we can say it is very important to learn about “Process Scheduling In OS”.
We will advise, that if you want to become an Expert in the Operating System Field, then you should not ignore the Process Scheduling Concept. Because, when you move deeper into the Operating Systems, you will find everything is related to Scheduling.
Takeaways:
The Scheduling States and Queues are interconnected which helps to execute processes.
Some important Schedulers are Long Term, Short Term, Medium, Real-Time, etc.
Round Robin, Preemptive Priority, SRTF, etc. are important Scheduling Algorithms.
Context Switching is used to Multitask in Operating Systems.
Starvation, Deadlock, Overhead, etc. are some of the Challenges in Scheduling.


