×

Process Schedulers and Process Queue in OS

Process Schedulers

There are various types of Process Schedulers:

  1. Long Term Scheduler
  2. Short Term Scheduler
  3. Medium Term Scheduler                                           
Process Schedulers

Long Term Scheduler: - Long term scheduler is also referred to as Job Scheduler. The task of the Long-term scheduler is to select the process from secondary storage and hold them in the ready queue, which is in the primary storage. The main task performed by the long-term scheduler is to select the faultless combination of IO-bound and CPU bound processes from the job pool. If any situation arises when job schedulers want to select more than one IO processes then due to this, there may be a possibility that all the jobs enter into the blocked state, and maximum of the time, the CPU will remain in ideal state, and due to this, the degree of multi-programming gets reduced. Therefore, the long-term scheduler must choose both IO and CPU bound processes efficiently and appropriately.

Short Term Scheduler: - The task performed by the short-term scheduler is to choose one of the jobs from the ready queue and send it for execution to the CPU. Short Term Scheduler means a CPU scheduler. In Short term scheduler, we use a scheduling algorithm to choose the job for execution. In some cases, the job of short-term scheduler may be critical such as if the CPU burst time of a selected job is high. Then the other jobs will have to wait for a long time in the ready queue. This problem is called Starvation.

Difference between Long-Term Scheduler, Short-Term Scheduler, and Middle-Term Scheduler

S.No Long-term scheduler Short-term scheduler Middle-term scheduler
1. The Long-term scheduler means a Job Scheduler. A short-term scheduler means a CPU Scheduler. Middle-term means a process is swapping scheduler.
2. The speed of the Long-term scheduler is less than the short-term scheduler. The speed of the short-term scheduler is faster than the long-term scheduler, and Medium-term scheduler. The speed of the Middle-term scheduler is between the short-term scheduler and the long-term scheduler.
3. The long-term scheduler first chooses the process from memory, and after that, it loads the process from memory then executes it.   The short-term scheduler chooses those processes that are ready to execute. The medium-term scheduler helps to reintroduce the process in the memory so that the process execution can be continued again.
4. In a time-sharing system, the Long-term scheduler does not exist. In a time-sharing system, Short-term scheduler is less exist. A Medium-term scheduler is just like a part of Time-sharing systems.  

Medium Term Scheduler: - The Medium-term scheduler is responsible for having the process suspended and resumed. It primarily switches (moving processes from main memory to disk and disk to main memory). In the medium-term scheduler, swapping is used to increase the performance of the process mix or due to changes in the requirements of memory that have over-engaged available memory that needs memory to be released.

Process Queue

The operating system handles a number of queues for a process state. The process-related to program control block (PCB) is also stored in a queue. When the process switches the state from one state to another state, then the PCB (Program Control Block) of that process is also getting unlinked from the queue and then link to another state queue in which the transition takes place.

There are various types of queue:

  1. Job Queue
  2. Ready Queue
  3. Waiting Queue
Process Queue
  1. Job Queue: - All processes are placed in the job queue at the beginning. It is kept in secondary storage. The long-term scheduler selects a few of the jobs and places them in the primary storage.
  2. Ready Queue: - The primary memory holds the ready queue. In ready queue with the help of the short-term scheduler, we select the job for the execution from the ready queue, and then we will dispatch it to the CPU.
  3. Waiting Queue: - In the ready queue, if the process requires doing some operations means any input/output operation to finished its execution, then it is must that the operating system switches the process state from running to the waiting state. The context (Program Control Block) is stored in the waiting18 queue that will be used by the processor when the IO is done.

Related Topics

Unix Operating System

Unix Operating System Unix Operating System is a multiuser, portable, time-sharing, and multitasking operating system that was developed in 1969. Unix operating system was developed by a group of AT &...

3 minutes read.

Difference between Seek Time and Disk Access Time in Disk Scheduling

Seek Time The time taken for the hard disk controller to detect a specific piece of recorded data is known as the seek time. The amount of time it takes to...

4 minutes read.

Fixed Partitioning in Operating System

Fixed Partitioning in OS Fixed Partitioning is also known as Contiguous memory allocation. Fixed Partitioning is the easiest method, which is used to load more than one process into the main memory. In Fixed...

5 minutes read.

Difference between Rotational Latency and Disk Assess Time in Disk Scheduling

Disk scheduling is used by operating systems to arrange the arrival of I/O requests to the disc. Disk scheduling is necessary because several I/O requests may occur from various processes,...

4 minutes read.

CPU Scheduling in OS

What is Scheduling? Scheduling is the process that is used to share the computing resources such as memory, processor time, and bandwidth to the different processes, data flows, threads, and applications that need...

5 minutes read.

How to implement Monitors using Semaphores

Monitors Monitor is a type of synchronization device designed to solve difficulties caused by semaphores, such as timing errors. Monitors are the type of data types that are abstract by nature...

2 minutes read.

What is Deadlock in OS?

Deadlock in Operating System In an Operating System, a process uses various resources, and the resources are used in the following manner: Request the ResourceUse the ResourceRelease the Resource In the Operating System, Deadlock is a condition...

4 minutes read.

Disk Scheduling Algorithms

Disk Scheduling Algorithms Disk scheduling algorithms are the algorithms that are used for scheduling a disk. Generally, the scheduling refers to a time-table for completing any task or a job. With the help...

2 minutes read.

Operating System Services

The Operating System provides various types of services:   I/O operationProgram executionFile system manipulationCommunicationError HandlingResource allocationAccountingProtection 1. I/O Operation: - To execute a program, needs I/O, which consists of a file, or I/O device. Due to the protection...

3 minutes read.

Commercial Mobile Operating Systems

Introduction to Commercial Mobile Operating Systems A computer program's common services are managed by an operating system (OS), which also handles computer hardware and software resources. The user can communicate with...

7 minutes read.

File Access Methods in Operating System

File Access Methods in OS There are various types of file access methods in the operating system: Sequential Access MethodDirect Access MethodIndex Sequential Access Method Sequential Access Method: - Sequential Access Method is...

3 minutes read.

Directory Structure in Operating System

Directory Structure in Operating System What is a Directory A Directory is the collection of the correlated files on the disk. In simple words, a directory is like a container which contains...

8 minutes read.

Multiprogramming Operating System

You will discover more about the multiprogramming operating system in this post, including how it functions and its benefits and drawbacks. Each process needs several types of system time, including CPU...

4 minutes read.

FCFS Scheduling in OS

FCFS: First Come First Serve Scheduling in OS FCFS is a non-preemptive and preemptive scheduling algorithm that is easy to understand and use. In this, the process which reaches first is...

3 minutes read.

Difference between SCAN and FCFS Disk Scheduling Algorithm

SCAN / Elevator Algorithm A different form of disc scheduling method is the SCAN disc scheduling algorithm. We move the disc arm in a certain direction in this process (the direction...

3 minutes read.

Memory Management in Operating System

The term "Main Memory" refers to the computer's internal physical memory. It is distinguished from external mass storage devices like disk drives by using the term "main." RAM is another...

4 minutes read.

Multitasking Operating Systems

An operating system is the fundamental piece of software that enables a computer system to function and execute a command as intended. The user interface, hardware, and every other piece...

7 minutes read.

Difference between Process and Program in the Operating System

What is a process in the Operating System? A process is a program that is going through the execution. It also helps us to execute all the lines of code in...

4 minutes read.

Round-Robin Scheduling Algorithm in OS

Round-Robin is a Preemptive Scheduling Algorithm and is the most commonly used algorithm in CPU Scheduling.In this, each Process is assigned with a fix time interval to execute, which is...

5 minutes read.

File Allocation Methods in Operating System

A file allocation method is a way that an operating system stores and retrieves files on a storage device, such as a hard drive or SSD. The file allocation method...

4 minutes read.