Professional Documents
Culture Documents
Deadlock and Disk Scheduling
Deadlock and Disk Scheduling
Submitted to :
Submitted by :
prof. Balram Yadav
Pandey
(Lecturer)
Contents :
Deadlock : Introduction
Deadlock : Conditions
Resource-Allocation Graph
Deadlock States
Deadlock Handling
Deadlock Prevention
Contents :
Deadlock Avoidance
Deadlock Detection
Disk Scheduling : Terminologies
Moving-head Disk Mechanism
Scheduling Algorithms
First Come First Served (FCFS)
Contents :
Deadlock : Introduction
A deadlock consists of a set of blocked processes,
each holding a resource and waiting to acquire a
resource held by another process in the set.
Processe
s:
P1 and
P2
Resource
s:
R1 and
R2
Deadlock : Conditions
Deadlock can arise if four conditions hold
simultaneously :
Mutual Exclusion
Hold and Wait
No Preemption
Circular Wait
Resource-Allocation Graph
If the resource
allocation
graph contains
no cycles no
deadlock.
Deadlock States
If a system
is in safe
state no
deadlock
exists
Deadlock Handling
Prevention
Ensure that the system will never enter a deadlock state
Avoidance
Ensure that the system will never enter an unsafe state
Detection
Allow the system to enter a deadlock state and then
recover.
Deadlock Prevention
Deadlock can be prevented by ensuring that at least
one of the conditions of deadlock cant hold, i.e.
Mutual Exclusion
Hold and wait
No Preemption
Circular Wait
Deadlock Avoidance
Deadlock avoidance requires additional information about
how the resources will be requested.
Deadlock Detection
For deadlock detection, the system must provide :
An algorithm that examines the state of the system to detect
whether a deadlock has occurred.
And an algorithm to recover from the deadlock.
written on a disk.
Track : It is the collection of sectors all on some
circumference on a single surface.
Cylinder : It is collection of all tracks of same radius on a
multiplatter disk.
Seek Time : It is the time for read/write head to find the
desired cylinder.
Latency Time : It is the time for disk rotate to the start of
the desired sector.
Scheduling Algorithms
Several algorithms exist to schedule the servicing
of
SCAN
C-SCAN
C-LOOK
References :
www.google.com
www.Wikipedia.com
Operating System Concepts : Siberschatz, Galvin
and Gagne