Type Here to Get Search Results !

What is Long term Short term and Medium term schedular ?

Schedulers play a crucial role in managing the allocation of resources and executing processes efficiently. Among the various types of schedulers Long term short term and medium term schedular stand out, each serving distinct functions within the system. 

In a computer system, an important function of the operating system (OS) is to manage the processes. There are three main types of schedulers: Long term short term and medium term schedular. Let us understand these three schedulers in simple terms.

In this article, we are going to tell you the difference between schedulers and their importance, along with its specific role, features and what impact it has on system performance.

Long term short term and medium term schedular

What is Long Term scheduler in OS ?

The long term scheduler is also called the job scheduler. This scheduler decides which processes (jobs) enter the system and when to produce output. It loads jobs into the computer's memory (RAM) so that they can run on the CPU.

Functions of Long Term Scheduler :

1. Job Selection: 

  • The long term scheduler decides which new processes are to enter the system. 
  • It selects the jobs keeping in mind the facts of the system.
2. Memory Lock: 

  • Loads the selected jobs into the memory (RAM). 
  • It ensures that the jobs come into the ready state so that the short term scheduler can run them on the CPU.

3. Managing the Baseline: 

  • The long term scheduler ensures the proper utilization of the system's baseline.
  • It makes sure that there are not too many jobs on the system, which does not affect the system aspects.

Benefits of Long Term Scheduler :

Improving system performance: 
  • The long term scheduler ensures that only as many processes run on the system as the resources can handle. 
  • This improves the speed and effectiveness of the system.
Maintaining balance: 
  • This scheduler maintains a balance between CPU and memory. 
  • This increases the stability of the system and makes better use of resources.
Setting priority: 
  • The long term scheduler can decide to run important jobs first. 
  • This ensures that important jobs are completed quickly and increases user satisfaction.

Examples of Long Term Scheduler :

Batch Processing Systems: 
  • Old batch processing systems used long term schedulers. 
  • In this, jobs were loaded in a batch and then they were run one by one.
Modern Operating Systems: 
  • Modern operating systems, such as Windows and Linux, also use long term schedulers. 
  • These systems use this scheduler to manage their jobs effectively.

What is Short Term Scheduler in OS ?

The short term scheduler, also known as the CPU scheduler, is the scheduler that decides which process will currently run on the CPU. This scheduler switches between processes rapidly, so that the system performance remains at a high level.

Functions of Short Term Scheduler :

Selection of processes:
  • The short term scheduler selects one of the processes present in the ready state to run on the CPU.
  • This selection takes place at an interval of a few milliseconds, so that the CPU can be utilized optimally.
Priority determination:
  • This scheduler decides to run processes on the CPU based on their priority.
  • Processes with high priority are run first, while processes with low priority are run later.
Context switching:
  • The short term scheduler also performs context switching.
  • This involves removing one process from the CPU and running another process.
  • This happens very fast, so that the user does not feel any delay.

Benefits of Short Term Scheduler :

Faster response:
  • Short term scheduler helps the system to respond faster.
  • This gives a better experience to the users as they do not feel any delay in their tasks.
Better performance:
  • This scheduler ensures that the CPU is used to the maximum.
  • This increases the performance of the system and tasks are completed faster.
Priority management:
  • Short term scheduler manages the processes on the basis of priority.
  • This allows the important processes to complete first, thereby increasing the efficiency of the system.

Examples of Short Term Scheduler :

Round-Robin Scheduling:
  • In this technique, all the processes are given equal time slots one by one.
  • This technique is simple and ensures that all the processes run fairly.
Priority Scheduling:
  • In this, processes are run on the CPU based on their priority.
  • Processes with higher priority are run first.
First-Come-First-Serve (FCFS) Scheduling:
  • In this, the process which comes first is run first.
  • This is the simplest scheduling technique.

What is medium Term Scheduler in OS ?

Medium term scheduler is a type of scheduler that takes processes out of memory and brings them back as needed. It is also called swapping scheduler. Medium term scheduler manages the memory of the system and ensures that processes are brought into memory at the appropriate time.

Functions of Medium Term Scheduler :

Swapping:
  • The main function of medium term scheduler is swapping.
  • This scheduler takes out the processes from memory that are not required to run immediately.
  • These processes can be brought back later when space is available in the memory.
Memory Management:
  • Medium term scheduler manages the memory so that the functionality of the system is maintained.
  • It ensures that the memory is used effectively and no process is occupying space in the memory unnecessarily.
Performance Improvement:
  • This scheduler improves the performance of the system.
  • By swapping processes as needed, this scheduler ensures that only the necessary processes remain in the memory.

Benefits of Medium Term Scheduler :

Better Memory Utilization:

  • The medium term scheduler ensures better memory utilization.
  • By swapping out unnecessary processes, it makes space in the memory.

Improving Performance:

  • This scheduler improves the speed and performance of the system.
  • Only the necessary processes remain in the memory, making the system work faster.

Balancing of Processes:

  • The medium term scheduler maintains a balance between the processes.
  • It ensures that the processes in the system run at the proper time and enough space is maintained in the memory.

Examples of Medium Term Scheduler :

Virtual Memory System:
  • In virtual memory systems, the medium term scheduler is used for swapping processes.
  • This leads to effective use of memory and increases the efficiency of the system.
Multi-Programming System:
  • In multi-programming systems, the medium term scheduler performs swapping between different processes.
  • It ensures that all the processes run at the proper time.
Scheduler Comparison

Comparison of Long-Term, Short-Term, and Medium-Term Schedulers

Feature Long-Term Scheduler Short-Term Scheduler Medium-Term Scheduler
Function Determines which processes are admitted to the system for processing. Decides which of the ready, in-memory processes are executed by the CPU. Handles swapping processes in and out of memory to manage the degree of multiprogramming.
Frequency Runs less frequently, e.g., when a new process is created. Runs very frequently, often every few milliseconds. Runs moderately frequently, depending on the need to swap processes.
Speed Relatively slow, as it involves selecting which processes to admit. Very fast, as it involves selecting from the ready queue. Moderate speed, as it involves swapping processes between memory and disk.
Goal To provide a balanced mix of CPU-bound and I/O-bound processes. To maximize CPU utilization and provide responsive time-sharing. To manage memory and ensure that there is enough space for new processes.
Also Known As Job Scheduler CPU Scheduler Swapping Scheduler
Example Usage Selecting which jobs (processes) to load into the system from a job queue. Choosing which ready process will execute next on the CPU. Swapping out a process to disk to make space for a new process in memory.

Conclusion

The Long term short term and medium term schedular all play a vital role in managing the processes of a computer system. The long term scheduler controls the entry of processes into the system, the short term scheduler manages CPU usage, and the medium term scheduler manages memory and swapping. 

The proper coordination of these three schedulers makes effective and efficient operation of the system possible.

Post a Comment

0 Comments