Movatterモバイル変換


[0]ホーム

URL:


PPT, PDF10,723 views

Operating System: Deadlock

The document discusses the concept of deadlock in operating systems, providing definitions and examples, including a real-world analogy with trains. It outlines methods for deadlock prevention, avoidance, detection, and recovery, as well as the use of the Banker's algorithm for safe resource allocation. Various examples are presented to illustrate safe and unsafe states in resource allocation scenarios.

Embed presentation

Downloaded 250 times
1BY THE NAME OF ALLAH
GROUP: MOUNTAIN OFLIGHT MD. Saidur Rahman Kohinoor [142-15-3669] Md. Mudasser-ul Haque [142-15-3688] Obaidul Hassan [142-15-3559] Israt ZaHan Esha [142-15-3604] Md. Hamia [142-15-3458]2
DEADLOCKOperating System3
WHAT IS DEADLOCK?o An example from US Kansas law:o “When two trains approach each other at acrossing, both shall come to a full stop andneither shall start up again until the otherhas gone.”4[142-15-3669]
REAL WORLDDEADLOCKS!5• Truck A has to waitfor truck B tomove• Notdeadlocked[142-15-3669]
REAL WORLD DEADLOCKS!6Neither truck can proceed[142-15-3669]
GRAPH WITHOUT ADEADLOCK7R1P1P2P3R2P4[142-15-3669]
GRAPH WITH A DEADLOCK8R1P1 P2 P3R3R2R4[142-15-3669]
DEALING WITH DEADLOCKSo Stop a deadlock ever occuringo deadlock preventiono disallow at least one of the necessaryconditionso deadlock avoidanceo see a deadlock coming and alter theprocess/resource allocation strategy9continued[142-15-3669]
 Deadlock detection and recovery Ignore the problemdone by most OS, including UNIXcheap solutioninfrequent, manual reboots may beacceptable10[142-15-3669]
DEADLOCK PREVENTION Eliminate one (or more) of:mutual exclusionhold and waitno preemption (i.e. have preemption)circular wait11[142-15-3688]
ELIMINATE MUTUALEXCLUSION Shared resources do not require mutualexclusione.g. read-only files But some resources cannot be shared (at thesame time)e.g. printers12[142-15-3688]
DEADLOCK AVOIDANCE In deadlock avoidance, the necessaryconditions are untouched. Instead, extra information about resources isused by the OS to do better forward planningof process/resource allocationindirectly avoids circular wait13[142-15-3688]
SAFE STATES• An OS is in a safe state if there is asafe sequence of process executions<P1, P2, …, Pn>.• A safe state cannot lead to deadlock.• An unsafe state may lead to deadlock.• Deadlock is avoided by always keepingthe system in a safe state– this may reduce resource utilization 14DeadlockUnsafeSafe[142-15-3559]
EXAMPLE 1 Max no. of resources: 12 tape drives Max needs Current AllocationP0 10 5P1 4 2P2 9 2 Currently, there are 3 free tape drives The OS is in a safe state, since <P1, P0, P2> is asafe sequence.15[142-15-3559]
EXAMPLE 2 Same as last slide, but P2 now has 4 tapedrives allocated currently. Max needs Current AllocationP0 10 5P1 4 2P2 9 4 The OS is in an unsafe state.16[142-15-3559]
BANKER’S ALGORITHM Assume that:a resource can have multiple instancesthe OS has N processes, M resource types Initially, each process must declare themaximum no. of resources it will need. Calculate a safe sequence if possible.17[142-15-3604]
WAIT-FOR GRAPH• Assume that each resource has only oneinstance.• Create a wait-for graph by removing theresource types nodes from a resource allocationgraph.• Deadlock exists if and only if the wait-for graphcontains a cycle.18[142-15-3604]
EXAMPLE19R1P2R3 R4R2 R5P1 P3P5P4P2P1 P3P5P4[142-15-3604]
BANKER’S ALGORITHMVARIATION If a resource type can have multiple instances,then an algorithm very similar to the banker’salgorithm can be used. The algorithm investigates every possibleallocation sequence for the processes thatremain to be completed.20[142-15-3604]
EXAMPLE Resource Type InstancesA 7B 2C 621continued[142-15-3604]
Allocation Request AvailableA B C A B C A B CP0 0 1 0 0 0 0 0 0 0P1 2 0 0 2 0 2P2 3 0 3 0 0 0P3 2 1 1 1 0 0P4 0 0 2 0 0 2 The OS is not in a deadlocked state since<P0, P2, P3, P1, P4> is a safe sequence.22[142-15-3604]
EXAMPLE 2 Change P2 to request 1 C instance23AllocationAllocation RequestRequest AvailableAvailableA B CA B C A B CA B C A B CA B CPP00 0 1 00 1 0 0 0 00 0 0 0 0 00 0 0PP11 2 0 02 0 0 2 0 22 0 2PP22 3 0 33 0 3 0 00 0 11PP33 2 1 12 1 1 1 0 01 0 0PP44 0 0 20 0 2 0 0 20 0 2The OSThe OS isis deadlocked.deadlocked.[142-15-3604]
DEADLOCK RECOVERY Tell the operator System-based recovery:abort one or more processes in the circularwaitpreempt resources in one or more deadlockedprocesses24[142-15-3458]
PROCESS TERMINATION Abort all deadlocked processes, or Abort one process at a time until thedeadlocked cycle disappearsnot always easy to abort a processchoice should be based on minimum cost25[142-15-3458]
RESOURCE PREEMPTION Issues:how to select a resource(e.g. by using minimum cost)how to rollback the process which has justlost its resourcesavoiding process starvation26[142-15-3458]
27
28

Recommended

PPTX
Deadlocks in operating system
PPT
Operating System Deadlock Galvin
PPTX
Dead Lock in operating system
PPT
Chapter 7 - Deadlocks
PPTX
Deadlock Presentation
PPT
Deadlock Detection
PPT
deadlock avoidance
PPTX
Deadlock Avoidance in Operating System
PPT
Deadlock
DOCX
Operating System Process Synchronization
PDF
Deadlock
PDF
Semaphores
PPTX
Deadlock Prevention
PPTX
Transactions and Concurrency Control
PPTX
Deadlock ppt
PPTX
Operating system paging and segmentation
PPTX
Concurrency Control in Database Management System
PPTX
Timestamp protocols
PPTX
Deadlock dbms
PDF
7 Deadlocks
PPTX
Process synchronization in Operating Systems
PPTX
Concurrency control
PPT
17. Recovery System in DBMS
PPTX
Critical section problem in operating system.
PPT
Mutual exclusion and sync
PPT
Contiguous Memory Allocation.ppt
DOCX
BANKER'S ALGORITHM
PDF
Giao trinh ke toan excel co ban
PDF
Ilc day 2 feb. 19th sba digital library 2015

More Related Content

PPTX
Deadlocks in operating system
PPT
Operating System Deadlock Galvin
PPTX
Dead Lock in operating system
PPT
Chapter 7 - Deadlocks
PPTX
Deadlock Presentation
PPT
Deadlock Detection
PPT
deadlock avoidance
PPTX
Deadlock Avoidance in Operating System
Deadlocks in operating system
Operating System Deadlock Galvin
Dead Lock in operating system
Chapter 7 - Deadlocks
Deadlock Presentation
Deadlock Detection
deadlock avoidance
Deadlock Avoidance in Operating System

What's hot

PPT
Deadlock
DOCX
Operating System Process Synchronization
PDF
Deadlock
PDF
Semaphores
PPTX
Deadlock Prevention
PPTX
Transactions and Concurrency Control
PPTX
Deadlock ppt
PPTX
Operating system paging and segmentation
PPTX
Concurrency Control in Database Management System
PPTX
Timestamp protocols
PPTX
Deadlock dbms
PDF
7 Deadlocks
PPTX
Process synchronization in Operating Systems
PPTX
Concurrency control
PPT
17. Recovery System in DBMS
PPTX
Critical section problem in operating system.
PPT
Mutual exclusion and sync
PPT
Contiguous Memory Allocation.ppt
DOCX
BANKER'S ALGORITHM
Deadlock
Operating System Process Synchronization
Deadlock
Semaphores
Deadlock Prevention
Transactions and Concurrency Control
Deadlock ppt
Operating system paging and segmentation
Concurrency Control in Database Management System
Timestamp protocols
Deadlock dbms
7 Deadlocks
Process synchronization in Operating Systems
Concurrency control
17. Recovery System in DBMS
Critical section problem in operating system.
Mutual exclusion and sync
Contiguous Memory Allocation.ppt
BANKER'S ALGORITHM

Viewers also liked

PDF
Giao trinh ke toan excel co ban
PDF
Ilc day 2 feb. 19th sba digital library 2015
DOCX
PORTFOLIOText%20Sets[1]
PDF
Tebuu
PDF
Ilc fresno sbac digital library 2015.pptx
PDF
Ilc lff parb and sbac digital library 2016.pptx
PDF
Katekese Digital
DOCX
Absen kls bu nurr
PDF
Keluarga Era Digital
PPTX
Anafilaxia inmunoalergo
PDF
I love Allah
PPTX
The art of slow reading presentation
DOC
Identifying similes and metaphors
PPTX
ODD presentation
DOCX
Distribution Letter
PPT
Os module 2 d
PPT
Galvin-operating System(Ch8)
DOCX
Banker's note - Blackstone Synergy Pitch
PDF
PPT
Mca ii os u-3 dead lock & io systems
Giao trinh ke toan excel co ban
Ilc day 2 feb. 19th sba digital library 2015
PORTFOLIOText%20Sets[1]
Tebuu
Ilc fresno sbac digital library 2015.pptx
Ilc lff parb and sbac digital library 2016.pptx
Katekese Digital
Absen kls bu nurr
Keluarga Era Digital
Anafilaxia inmunoalergo
I love Allah
The art of slow reading presentation
Identifying similes and metaphors
ODD presentation
Distribution Letter
Os module 2 d
Galvin-operating System(Ch8)
Banker's note - Blackstone Synergy Pitch
Mca ii os u-3 dead lock & io systems

Similar to Operating System: Deadlock

PPT
6. Deadlock.ppt
PPTX
deadlock in OS.pptx
PPS
Deadlock
PPTX
Algorithm 4Chapter Four- Deadlock (5).pptx
PPTX
Deadlock - An Operating System Concept.pptx
PPTX
hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
PDF
Deadlocks Part- III.pdf
PPTX
Module 3 Deadlocks.pptx
PPTX
Deadlock
PPT
Module-2Deadlock.ppt
PPT
Principles of Operating system and types
PPTX
OSLec14&15(Deadlocksinopratingsystem).pptx
PPTX
Lecture 4 Deadlocks in operating systems.pptx
PDF
Chapter 5(five).pdf
PPTX
Chapter 6 - Operating System Deadlock.pptx
PDF
CH07.pdf
PPTX
Lecture 6- Deadlocks (1) (1).pptx
PPTX
Deadlocks by wani zahoor
PPT
A ppt on deadlock in operating systems for the better explanation
6. Deadlock.ppt
deadlock in OS.pptx
Deadlock
Algorithm 4Chapter Four- Deadlock (5).pptx
Deadlock - An Operating System Concept.pptx
hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
Deadlocks Part- III.pdf
Module 3 Deadlocks.pptx
Deadlock
Module-2Deadlock.ppt
Principles of Operating system and types
OSLec14&15(Deadlocksinopratingsystem).pptx
Lecture 4 Deadlocks in operating systems.pptx
Chapter 5(five).pdf
Chapter 6 - Operating System Deadlock.pptx
CH07.pdf
Lecture 6- Deadlocks (1) (1).pptx
Deadlocks by wani zahoor
A ppt on deadlock in operating systems for the better explanation

More from InteX Research Lab

PDF
Workshop on IEEE vTools: Getting Involve with IEEE Volunteer Tools
PPSX
IEEE Student and Professional Membership Benefits
PPTX
Writing and Publishing a Scientific Research Paper
PPSX
IEEE Membership Benefits for Students
PPTX
Instruction pipeline: Computer Architecture
PPT
Floyd Warshall Algorithm
PPTX
Electric Motor...
Workshop on IEEE vTools: Getting Involve with IEEE Volunteer Tools
IEEE Student and Professional Membership Benefits
Writing and Publishing a Scientific Research Paper
IEEE Membership Benefits for Students
Instruction pipeline: Computer Architecture
Floyd Warshall Algorithm
Electric Motor...

Recently uploaded

PDF
IAAM Meetup #7 chez Onepoint - Construire un Rag-as-a-service en production. ...
PDF
Breaking the Vulnerability Management Cycle with Anchore and Echo
PDF
SWEBOK: the software engineering body of knowledge (SC25 Workshop Research So...
PDF
DSD-INT 2025 3D Modeling of Shallow Water Dynamics Using Delft3D FM - Martins
PDF
DSD-INT 2025 Next-Generation Flood Inundation Mapping for Taiwan - Challenges...
PDF
DevOps Monitoring Tools: The 2025 Guide to Performance & Observability
PDF
PROJECT REPORT cat2.pdf
PPTX
AI Clinic Management Tool for Dermatologists Making Skin Care Smarter, Simple...
PDF
DSD-INT 2025 Exploring different domain decomposition approaches for enhanced...
PDF
DSD-INT 2025 UK Coastal Flooding Incident Guide - Dam
PDF
DSD-INT 2025 From Software to Impact - Water Quality Modelling for the UN Oce...
PPTX
Key Benefits of Odoo Customization Services
PDF
DSD-INT 2025 Building-Aware Flood and Lifeline Scour Modeling with Delft3D FM...
PDF
BCA 1st Semester Fundamentals Solved Question Paper 44121
PPTX
Future of Software Testing: AI-Powered Open Source Testing Tools
PDF
DSD-INT 2025 Hydrodynamic and Morphodynamic Modeling with Delft3D FM for an I...
PDF
DSD-INT 2025 Understanding the Paraguay River Response to Hard Bottom Dredgin...
PDF
DSD-INT 2025 Delft3D FM Suite 2026.01 2D3D - New features + Improvements - Sp...
PDF
SCORM Cloud: The 5 categories of content distribution
PPTX
The Sync Strikes Back: Tales from the MOPs Trenches
IAAM Meetup #7 chez Onepoint - Construire un Rag-as-a-service en production. ...
Breaking the Vulnerability Management Cycle with Anchore and Echo
SWEBOK: the software engineering body of knowledge (SC25 Workshop Research So...
DSD-INT 2025 3D Modeling of Shallow Water Dynamics Using Delft3D FM - Martins
DSD-INT 2025 Next-Generation Flood Inundation Mapping for Taiwan - Challenges...
DevOps Monitoring Tools: The 2025 Guide to Performance & Observability
PROJECT REPORT cat2.pdf
AI Clinic Management Tool for Dermatologists Making Skin Care Smarter, Simple...
DSD-INT 2025 Exploring different domain decomposition approaches for enhanced...
DSD-INT 2025 UK Coastal Flooding Incident Guide - Dam
DSD-INT 2025 From Software to Impact - Water Quality Modelling for the UN Oce...
Key Benefits of Odoo Customization Services
DSD-INT 2025 Building-Aware Flood and Lifeline Scour Modeling with Delft3D FM...
BCA 1st Semester Fundamentals Solved Question Paper 44121
Future of Software Testing: AI-Powered Open Source Testing Tools
DSD-INT 2025 Hydrodynamic and Morphodynamic Modeling with Delft3D FM for an I...
DSD-INT 2025 Understanding the Paraguay River Response to Hard Bottom Dredgin...
DSD-INT 2025 Delft3D FM Suite 2026.01 2D3D - New features + Improvements - Sp...
SCORM Cloud: The 5 categories of content distribution
The Sync Strikes Back: Tales from the MOPs Trenches
In this document
Powered by AI

Introduction of the group and a prayer.

Definition of deadlock, real-world examples using trucks and law analogy.

Graphs illustrating scenarios with and without deadlock.

Strategies for dealing with deadlocks, including prevention, avoidance, detection, and recovery.

Techniques to prevent deadlocks by eliminating mutual exclusion and other conditions.

Deadlock avoidance by maintaining a safe state and examples showing safe/unsafe sequences.

The Banker’s Algorithm for allocation and management of resources to prevent deadlocks.

Examples illustrating safe sequences and the impact of additional resource requests.

Methods for recovering from deadlocks, including process termination and resource preemption.

Final thoughts and wrap-up on the topic of deadlocks.

Operating System: Deadlock

  • 1.
    1BY THE NAMEOF ALLAH
  • 2.
    GROUP: MOUNTAIN OFLIGHTMD. Saidur Rahman Kohinoor [142-15-3669] Md. Mudasser-ul Haque [142-15-3688] Obaidul Hassan [142-15-3559] Israt ZaHan Esha [142-15-3604] Md. Hamia [142-15-3458]2
  • 3.
  • 4.
    WHAT IS DEADLOCK?oAn example from US Kansas law:o “When two trains approach each other at acrossing, both shall come to a full stop andneither shall start up again until the otherhas gone.”4[142-15-3669]
  • 5.
    REAL WORLDDEADLOCKS!5• TruckA has to waitfor truck B tomove• Notdeadlocked[142-15-3669]
  • 6.
    REAL WORLD DEADLOCKS!6Neithertruck can proceed[142-15-3669]
  • 7.
  • 8.
    GRAPH WITH ADEADLOCK8R1P1 P2 P3R3R2R4[142-15-3669]
  • 9.
    DEALING WITH DEADLOCKSoStop a deadlock ever occuringo deadlock preventiono disallow at least one of the necessaryconditionso deadlock avoidanceo see a deadlock coming and alter theprocess/resource allocation strategy9continued[142-15-3669]
  • 10.
     Deadlock detectionand recovery Ignore the problemdone by most OS, including UNIXcheap solutioninfrequent, manual reboots may beacceptable10[142-15-3669]
  • 11.
    DEADLOCK PREVENTION Eliminateone (or more) of:mutual exclusionhold and waitno preemption (i.e. have preemption)circular wait11[142-15-3688]
  • 12.
    ELIMINATE MUTUALEXCLUSION Sharedresources do not require mutualexclusione.g. read-only files But some resources cannot be shared (at thesame time)e.g. printers12[142-15-3688]
  • 13.
    DEADLOCK AVOIDANCE Indeadlock avoidance, the necessaryconditions are untouched. Instead, extra information about resources isused by the OS to do better forward planningof process/resource allocationindirectly avoids circular wait13[142-15-3688]
  • 14.
    SAFE STATES• AnOS is in a safe state if there is asafe sequence of process executions<P1, P2, …, Pn>.• A safe state cannot lead to deadlock.• An unsafe state may lead to deadlock.• Deadlock is avoided by always keepingthe system in a safe state– this may reduce resource utilization 14DeadlockUnsafeSafe[142-15-3559]
  • 15.
    EXAMPLE 1 Maxno. of resources: 12 tape drives Max needs Current AllocationP0 10 5P1 4 2P2 9 2 Currently, there are 3 free tape drives The OS is in a safe state, since <P1, P0, P2> is asafe sequence.15[142-15-3559]
  • 16.
    EXAMPLE 2 Sameas last slide, but P2 now has 4 tapedrives allocated currently. Max needs Current AllocationP0 10 5P1 4 2P2 9 4 The OS is in an unsafe state.16[142-15-3559]
  • 17.
    BANKER’S ALGORITHM Assumethat:a resource can have multiple instancesthe OS has N processes, M resource types Initially, each process must declare themaximum no. of resources it will need. Calculate a safe sequence if possible.17[142-15-3604]
  • 18.
    WAIT-FOR GRAPH• Assumethat each resource has only oneinstance.• Create a wait-for graph by removing theresource types nodes from a resource allocationgraph.• Deadlock exists if and only if the wait-for graphcontains a cycle.18[142-15-3604]
  • 19.
    EXAMPLE19R1P2R3 R4R2 R5P1P3P5P4P2P1 P3P5P4[142-15-3604]
  • 20.
    BANKER’S ALGORITHMVARIATION Ifa resource type can have multiple instances,then an algorithm very similar to the banker’salgorithm can be used. The algorithm investigates every possibleallocation sequence for the processes thatremain to be completed.20[142-15-3604]
  • 21.
    EXAMPLE Resource TypeInstancesA 7B 2C 621continued[142-15-3604]
  • 22.
    Allocation Request AvailableAB C A B C A B CP0 0 1 0 0 0 0 0 0 0P1 2 0 0 2 0 2P2 3 0 3 0 0 0P3 2 1 1 1 0 0P4 0 0 2 0 0 2 The OS is not in a deadlocked state since<P0, P2, P3, P1, P4> is a safe sequence.22[142-15-3604]
  • 23.
    EXAMPLE 2 ChangeP2 to request 1 C instance23AllocationAllocation RequestRequest AvailableAvailableA B CA B C A B CA B C A B CA B CPP00 0 1 00 1 0 0 0 00 0 0 0 0 00 0 0PP11 2 0 02 0 0 2 0 22 0 2PP22 3 0 33 0 3 0 00 0 11PP33 2 1 12 1 1 1 0 01 0 0PP44 0 0 20 0 2 0 0 20 0 2The OSThe OS isis deadlocked.deadlocked.[142-15-3604]
  • 24.
    DEADLOCK RECOVERY Tellthe operator System-based recovery:abort one or more processes in the circularwaitpreempt resources in one or more deadlockedprocesses24[142-15-3458]
  • 25.
    PROCESS TERMINATION Abortall deadlocked processes, or Abort one process at a time until thedeadlocked cycle disappearsnot always easy to abort a processchoice should be based on minimum cost25[142-15-3458]
  • 26.
    RESOURCE PREEMPTION Issues:howto select a resource(e.g. by using minimum cost)how to rollback the process which has justlost its resourcesavoiding process starvation26[142-15-3458]
  • 27.
  • 28.

[8]ページ先頭

©2009-2025 Movatter.jp