- Operating System Tutorial
- OS - Home
- OS - Overview
- OS - Components
- OS - Types
- OS - Services
- OS - Properties
- OS - Processes
- OS - Process Scheduling
- OS - Scheduling algorithms
- OS - Multi-threading
- OS - Memory Management
- OS - Virtual Memory
- OS - I/O Hardware
- OS - I/O Software
- OS - File System
- OS - Security
- OS - Linux
- OS - Exams Questions with Answers
- OS - Exams Questions with Answers
- Operating System Useful Resources
- OS - Quick Guide
- OS - Useful Resources
- OS - Discussion
What are Scheduling Queues?
The processes that are entering into the system are stored in the Job Queue. Suppose if the processes are in the Ready state are generally placed in the Ready Queue.
The processes waiting for a device are placed in Device Queues. There are unique device queues which are available for every I/O device.
First place a new process in the Ready queue and then it waits in the ready queue till it is selected for execution.
Once the process is assigned to the CPU and is executing, any one of the following events occur −
The process issue an I/O request, and then placed in the I/O queue.
The process may create a new sub process and wait for termination.
The process may be removed forcibly from the CPU, which is an interrupt, and it is put back in the ready queue.
In the first two cases, the process switches from the waiting state to the ready state, and then puts it back in the ready queue. A process continues this cycle till it terminates, at which time it is removed from all queues and has its PCB and resources deallocated.
Types of Schedulers
There are three types of schedulers available which are as follows −
Long Term Scheduler
Long term scheduling is performed when a new process is created, if the number of ready processes in the ready queue becomes very high. Then, there is an overhead on the operating system, for maintaining long lists, containing switching and dispatching increases. Therefore, allowing only a limited number of processes into the ready queue, the long term scheduler manages this.
Long term scheduler runs less frequently. It decides which program must get into the job queue. From the job queue, the job processor selects processes and loads them into the memory for execution.
The main aim of the Job Scheduler is to maintain a good degree of Multiprogramming. The degree of Multiprogramming means the average rate of process creation is equal to the average departure rate of processes from the execution memory.
The diagram of long term and short term scheduler is as follows −
Short Term Scheduler
Short term scheduler is called a CPU Scheduler and runs very frequently. The aim of the scheduler is to enhance CPU performance and increase process execution rate.
Medium Term Scheduler
This type of scheduling removes the processes from memory and thus reduces the degree of multiprogramming. Later, the process is reintroduced into memory and its execution is continued where it left off. This is called swapping. The process is swapped out, and is later swapped in, by the medium term scheduler.
The diagram of medium term scheduler is as follows −
- Related Articles
- What are different types of CPU scheduling and the scheduling criteria?
- What are the approaches of Instruction Scheduling?
- What are the types of Loop Scheduling?
- What are the different types of process states and queues?
- What is Global Scheduling?
- What is Process Scheduling?
- What are the functions of Scheduling Model in computer architecture?
- Dual Priority Queues
- What are the different levels of Code Scheduling in computer architecture?
- What is Basic block scheduling?
- Priority Queues with C#
- IPC using Message Queues
- Priority Queues in C++
- What is scheduling problem in computer architecture?
- What are the types of process scheduling algorithms and which algorithms lead to starvation?