Advertisement

job scheduling algorithm in Operating System

Scheduling Concepts

In Multiprogramming we run many processes at the same time in order to improve CPU utilization. In uni, programming CPU sits idles when a running process needs I/O operation, but in multiprogramming when one process needs I/O operation, then operating system gives the CPU to another process.

Benefits of Multiprogramming are:

i)                Increased CPU utilization and
ii)               Higher throughput (Throughput is the amount of work accomplished in a given time interval).


We have two processes P1 and P2. First, we run P1 that takes two minutes to complete, then we run P2 that also takes two minutes to complete. Although the process execution for each process is 1 minute due to I/O operations both processes took double-time to complete. So our CPU utilization is only 50 percent.
scheduling in operating system
System performance can be improved greatly if we multi-program process P1 and P2. Process P1 starts execution, as it needs I/O we start executing process P2, as P2 needs I/O until that time process P1 is ready to run again. Now both processes execute like this and the time of completion of both processes is 2 minutes. So, we have improved CPU utilization from 50 percent to 100 percent, and this utilization was achieved due to multiprogramming

Scheduler

When more than one process is run-able then Operating System decides which process to run first, so the part of an Operating System concerned with this decision is called the scheduler and the algorithm it uses is called the Scheduling Algorithm

Scheduling Queues

Job Queue
Job Queue consists of all processes residing in mass storage and waiting for the allocation of main memory.




Ready Queue
The processes that are residing in the main memory and are ready to execute are kept in a list called the Ready Queue. So, all the processes that are in ready state and waiting for CPU time are considered to be part of the ready queue.
dispatcher in operating system


Device Queue

Device Queue consists of processes that are waiting for some I/O device. So, all the processes that are in waiting or blocked state are considered to be part of device queue. Each device has its own device queue.
weighted job scheduling
Shareable Device Queues Sharable devices such as Printers, Hard Disks, and CDs etc can have several processes on its device queue 
managed print services