
Introduction
As we all know, the modern generation’s computer is way better than earlier generations in terms of multitasking. The improvements in multi-tasking performance are due to the efficient scheduling of the process assigned to a computer. Scheduling further relies on two major concepts: Scheduler and Dispatcher. The scheduler selects a process from a list of processes by applying some process scheduling algorithm. On the other hand, the dispatcher transfers the process selected by the short-term scheduler from one state to another.
In this article, we’ll be discussing what exactly the scheduler and dispatcher are in detail.
Multiprogramming vs Multitasking
Scheduler
A scheduler is essentially a software system. It can handle the scheduling of processes in a variety of ways. A scheduler's major responsibility is to select a process from several processes that need to be entered into a system for execution.
Types of scheduler
Long-term Scheduler
Due to the small size of the main memory(RAM), we initially store all of the programs in the secondary memory. These are known as processes when they are loaded or kept in the main memory. A long-term scheduler is granted control over how many processes must remain in the ready queue. To put it another way, a long-term scheduler is in charge of determining the amount of multiprogramming that is accessible in a system.
Short-term Scheduler
When there are many processes in the main memory, all of them appear in the ready queue at first. However, only one process must be chosen for execution from among all of these processes. All of these decisions are handled by a short-term scheduler.
Medium-term Scheduler (swapper)
The majority of the time, a running process needs an I/O operation that does not involve the use of a CPU. As a result, when an I/O operation is required during the execution of a process, the OS (Operating System) moves the targeted process from the running queue to the blocked queue. We must relocate a process back to the ready queue whenever it completes its initial I/O activity. All of these decisions are handled by a medium-term scheduler. Swapping is essentially the practice of medium-term scheduling.
You can also read about layered structure of operating system, Open Source Operating System.