23
Mahakal Institute Of Technology & Management Ujjain Deadlock And Disk Scheduling Submitted to : Submitted by : prof. Balram Yadav Anand Pandey (Lecturer)

Deadlock and Disk scheduling

Embed Size (px)

DESCRIPTION

Deadlock and Disk scheduling

Citation preview

PowerPoint Presentation

Mahakal Institute Of Technology & Management Ujjain

Deadlock And Disk Scheduling Submitted to : Submitted by :prof. Balram Yadav Anand Pandey(Lecturer) 0714CS121006Department CSE Department CSEMITM, Ujjain (M.P.) Contents :Deadlock : IntroductionDeadlock : ConditionsResource-Allocation GraphDeadlock StatesDeadlock HandlingDeadlock Prevention

Contents :Deadlock AvoidanceDeadlock DetectionDisk Scheduling : TerminologiesMoving-head Disk MechanismScheduling AlgorithmsFirst Come First Served (FCFS)

Contents :Shortest Seek Time First (SSTF)SCANC-SCANC-LOOK

Deadlock : IntroductionA 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.

Processes :P1 and P2Resources :R1 and R2Deadlock : ConditionsDeadlock can arise if four conditions hold simultaneously :

Mutual ExclusionHold and WaitNo PreemptionCircular WaitResource-Allocation Graph

If the resource allocation graph contains no cycles no deadlock.

Deadlock States

If a system is in safe state no deadlock existsDeadlock HandlingPrevention Ensure that the system will never enter a deadlock stateAvoidanceEnsure that the system will never enter an unsafe stateDetection Allow the system to enter a deadlock state and then recover.

Deadlock PreventionDeadlock can be prevented by ensuring that at least one of the conditions of deadlock cant hold, i.e.

Mutual ExclusionHold and waitNo PreemptionCircular WaitDeadlock AvoidanceDeadlock avoidance requires additional information about how the resources will be requested.

For a single instance of a resource type, we use a resource-allocation graph Algorithm.

For multiple instances of a resource type, we use the Bankers algorithm.

Deadlock DetectionFor 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.

Disk Scheduling : TerminologiesSector : It is the smallest block, that can be read or 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.

Moving-head Disk MechanismScheduling AlgorithmsSeveral algorithms exist to schedule the servicing of disk I/O requests :First Come First Served (FCFS).Shortest Seek Time First (SSTF).SCANC-SCANC-LOOK

First Come First Served (FCFS)

Shortest Seek Time First (SSTF)

SCAN

C-SCAN

C-LOOK

References :www.google.comwww.Wikipedia.comOperating System Concepts : Siberschatz, Galvin and Gagne