Process scheduling allows OS to allocate a time interval of CPU execution for each process. Another important reason for using a process scheduling system is that it keeps the CPU busy all the time. This allows you to get the minimum response time for programs.

What is Process Scheduling? Process Scheduling Queues
Two State Process Model
Scheduling Objectives
Type of Process Schedulers
Long Term Scheduler
Medium Term Scheduler
Short Term Scheduler
Difference between Schedulers
What is Context switch?

Process Scheduling Queues

Process Scheduling Queues help you to maintain a distinct queue for each and every process states and PCBs. All the process of the same execution state are placed in the same queue. Therefore, whenever the state of a process is modified, its PCB needs to be unlinked from its existing queue, which moves back to the new state queue. Three types of operating system queues are:

Job queue – It helps you to store all the processes in the system. Ready queue – This type of queue helps you to set every process residing in the main memory, which is ready and waiting to execute. Device queues – It is a process that is blocked because of the absence of an I/O device.

Process Scheduling Queues In the above-given Diagram,

Rectangle represents a queue. Circle denotes the resource Arrow indicates the flow of the process.

Every new process first put in the Ready queue .It waits in the ready queue until it is finally processed for execution. Here, the new process is put in the ready queue and wait until it is selected for execution or it is dispatched. One of the processes is allocated the CPU and it is executing The process should issue an I/O request Then, it should be placed in the I/O queue. The process should create a new subprocess The process should be waiting for its termination. It should remove forcefully from the CPU, as a result interrupt. Once interrupt is completed, it should be sent back to ready queue.

Two State Process Model

Two-state process models are:

Running State Not Running State

Running

In the Operating system, whenever a new process is built, it is entered into the system, which should be running.

Not Running

The process that are not running are kept in a queue, which is waiting for their turn to execute. Each entry in the queue is a point to a specific process.

Scheduling Objectives

Here, are important objectives of Process scheduling

Maximize the number of interactive users within acceptable response times. Achieve a balance between response and utilization. Avoid indefinite postponement and enforce priorities. It also should give reference to the processes holding the key resources.

Type of Process Schedulers

A scheduler is a type of system software that allows you to handle process scheduling. There are mainly three types of Process Schedulers:

Long Term Scheduler Short Term Scheduler Medium Term Scheduler

Long Term Scheduler

Long term scheduler is also known as a job scheduler. This scheduler regulates the program and select process from the queue and loads them into memory for execution. It also regulates the degree of multi-programing. However, the main goal of this type of scheduler is to offer a balanced mix of jobs, like Processor, I/O jobs., that allows managing multiprogramming.

Medium Term Scheduler

Medium-term scheduling is an important part of swapping. It enables you to handle the swapped out-processes. In this scheduler, a running process can become suspended, which makes an I/O request. A running process can become suspended if it makes an I/O request. A suspended processes can’t make any progress towards completion. In order to remove the process from memory and make space for other processes, the suspended process should be moved to secondary storage.

Short Term Scheduler

Short term scheduling is also known as CPU scheduler. The main goal of this scheduler is to boost the system performance according to set criteria. This helps you to select from a group of processes that are ready to execute and allocates CPU to one of them. The dispatcher gives control of the CPU to the process selected by the short term scheduler.

Difference between Schedulers

Long-Term Vs. Short Term Vs. Medium-Term

What is Context switch?

It is a method to store/restore the state or of a CPU in PCB. So that process execution can be resumed from the same point at a later time. The context switching method is important for multitasking OS.

Summary:

Process scheduling is an OS task that schedules the processes of different states like ready, waiting, and running. Two-state process models are 1) Running, and )Not Running Process scheduling maximizes the number of interactive users, within acceptable response times. A scheduler is a type of system software that allows you to handle process scheduling. Three types of the scheduler are 1) Long term 2) Short term 3) Medium-term Long term scheduler regulates the program and select process from the queue and loads them into memory for execution. The medium-term scheduler enables you to handle the swapped out-processes. The main goal of short term scheduler is to boost the system performance according to set criteria Long term is also known as a job scheduler, whereas the short term is also known as CPU scheduler, and the medium-term is also called swapping scheduler.