Unit 4
Unit 4
Scheduling Criteria
4.2
Scheduling algorithms
FCFS
CPU burst and I/O burst are two states of Not pre-emptive.
process execution
Process which voluntarily relinquishes control
CPU burst: The amount of time a process uses of CPU is added to end of ready queue.
the CPU to execute code. This is the running
Turnaround times cannot be guaranteed, so
state of the process.
not good for interactive environments.
I/O burst: The amount of time a process waits
Resource utilisation can be poor and unevenly
for input-output before needing CPU time. This
distributed.
is the waiting state of the process.
SJF
Modification of SJN to allow preemption by If there are too many ready processes, then
shorter jobs entering the ready queue. quantum size could be too small for any
process to do a significant amount of work
Long jobs have to wait even longer. before it is interrupted (sudden load
SRTN has to calculate how much Ɵme is degradation).
needed to complete the current job, and then Multilevel Queue
decide whether to switch processes if the new
process is only a bit shorter than the current Multilevel queue scheduling is a type of CPU
one. scheduling in which the processes in the ready
state are divided into different groups, each
SRTN (and SJN) try to maximise throughput. group having its own scheduling needs. The
ready queue is divided into different queues
Priority Based Scheduling according to different properties of the
process like memory size, process priority, or
Priority scheduling is a process scheduling process type. All the different processes can
algorithm that assigns priority to each process. be implemented in different ways, i.e., each
The scheduler selects tasks to work on based process queue can have a different scheduling
on their priority. algorithm.
Round Robin
Necessary conditions
1. Mutual Exclusion
2. Hold & Wait
3. No Pre-emption
4. Circular Wait
Deadlock Handling
1. Deadlock Prevention:
a. Elimination of any of the
necessary conditions
b. Detect & Recover
c. Static Process
2. Deadlock Avoidance
a. Eliminate Mutual
Exclusion: It is not
possible to dis-satisfy the
mutual exclusion because
some resources, such as