What Is a Long Term scheduler?
Overview
A long-term scheduler is a scheduler that is responsible for bringing processes from the JOB queue (or secondary memory) into the READY queue (or main memory). In other words, a long-term scheduler determines which programs will enter into the RAM for processing by the CPU.
Long-term schedulers are also called Job Schedulers. Long-term schedulers have a long-term effect on the CPU performance. They are responsible for the degree of multiprogramming, i.e., managing the total processes present in the READY queue.
Some operating systems do not have a long term scheduler. For example, time-sharing operating systems like Windows and UNIX usually don't have a long term scheduler. These systems put all the processes in the main memory for the short term scheduler.
What is the Function of a Long Term Scheduler?
The main function of a long-term scheduler is to minimize the processing time by balancing the CPU bound jobs (those jobs in which the majority of the time is spent on the CPU) and the I/O bound jobs (those jobs in which majority of the time is spent on the I/O operations).
Long-term schedulers need to maintain the degree of multiprogramming so that the average rate of creation of a process is equal to the average rate at which a process leaves the system. Since it takes a long time to complete an execution, the long term schedulers get enough time to decide which processes should be selected in the queue.
Example of a Long Term Scheduler
Consider a long-term scheduler that creates all I/O bound processes. In this case, the CPU will remain idle for most of the time and we will not be utilizing our CPU to its full potential. On the other hand, if a long-term scheduler creates all CPU-bound processes, then the I/O waiting for queue will remain idle for most of the time, the devices will remain unused, and the CPU will remain busy for a long time.
In these scenarios, we will not be utilizing the complete potential of our system. However, if the long term scheduler creates processes that have a perfect balance of both the CPU bound and I/O bound jobs, we will be utilizing the system to its full potential, hence reducing the process time.
Learn More About Scheduling Algorithm
Conclusion
- Long-term schedulers bring processes from the JOB queue (secondary memory) into the READY queue (main memory).
- A long-term scheduler is also called a Job Scheduler.
- Some operating systems do not have a long-term scheduler.
- The main purpose of a long-term scheduler is to balance the number of CPU-bound jobs and the I/O bound jobs in the main memory.