Unit II Lecture 9 Scheduling Part I
Unit II Lecture 9 Scheduling Part I
COMP301TH
Unit-II
Lecture: 9
(Scheduling)
CPU scheduling is the basis of multiprogrammed operating systems.
The sole purpose of implementing process scheduling for a CPU is to utilize the
processor and other resources to the fullest at any given time.
40
Operating System
COMP301TH
Types of Schedulers:
1. Long Term or Job Scheduler: Long term scheduler runs less frequently.
It brings the new process to the “Ready State”.
It controls Degree of Multiprogramming i.e. number of process
present in the ready state at any point of time.
Long term scheduler make a careful selection of both IO and CPU
bound process.
IO bound tasks are which use much of their time in input
and output operations while CPU bound processes are which
spend their time on CPU.
The job scheduler increases efficiency by maintaining the balance
between the two.
41
Operating System
COMP301TH
Turnaround time is the total time taken by the process to complete execution;
it includes burst time (service time) and waiting time.
42
Operating System
COMP301TH
1. First Come First Serve(FCFS): Schedule the processes on the basis of their
arrival time.
3. Shortest Job First (SJF): Processes with shortest Burst Time gets the CPU
first. If we have different Arrival Time we will have to use Preemptive
Scheduling technique.
4. Longest Job First: Processes with longest Burst Time gets the CPU first.
This is similar to shortest job first scheduling algorithm.
1. Shortest Remaining Time First (SRTF): Allot the processor to the process
that has shortest remaining time first. Remaining time calculated as:
Remaining Time = Total Burst time -CPU time already utilized by the process
2. Round Robin: Allot the processor to each of the process for a fixed time and
then “Context Switch” to next processes in queue in a cyclic manner.
3. Longest Remaining Time First: Allot the processor to the process that has
longest remaining time.
43