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
Dead Lock in operating system
PPTX
Deadlocks in operating system
PPT
deadlock avoidance
PPTX
Deadlock Avoidance in Operating System
PPT
Chapter 7 - Deadlocks
PPT
Operating System Deadlock Galvin
PPTX
Deadlock Presentation
PPT
Deadlock Detection
PPT
Deadlock
DOCX
Operating System Process Synchronization
PPTX
Transactions and Concurrency Control
PPTX
Concurrency Control in Database Management System
PDF
Semaphores
PPTX
Process synchronization in Operating Systems
PPT
Contiguous Memory Allocation.ppt
PPTX
Deadlock Prevention
PPTX
Deadlock dbms
PPTX
Deadlock ppt
PPTX
Timestamp protocols
PPTX
Operating system paging and segmentation
PDF
Deadlock
PPT
17. Recovery System in DBMS
PPTX
Critical section problem in operating system.
PPTX
Concurrency control
PPT
Mutual exclusion and sync
PDF
7 Deadlocks
DOCX
BANKER'S ALGORITHM
PDF
PPT
Mca ii os u-3 dead lock & io systems

More Related Content

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

What's hot

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

Viewers also liked

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

Similar to Operating System: Deadlock

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

More from InteX Research Lab

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

Recently uploaded

PDF
DSD-INT 2025 Modernizing Hydrodynamics in Large Flood Forecasting System - Mi...
PDF
DSD-INT 2025 Thermal and chemical plumes of sea cooling water from PEM platfo...
PDF
DSD-INT 2025 Delft3D FM Suite 2026.01 2D3D - New features + Improvements - Sp...
PDF
2025_11_19 - OpenMetadata Community Meeting.pdf
PDF
DSD-INT 2025 Next-Generation Flood Inundation Mapping for Taiwan - Challenges...
PDF
DSD-INT 2025 Transport and Fate of Microplastics in Fluvial System (Rhine Riv...
PDF
DevOps Monitoring Tools: The 2025 Guide to Performance & Observability
PDF
DSD-INT 2025 From Software to Impact - Water Quality Modelling for the UN Oce...
PDF
ECFT Case Study: Digital Pilot Transportation System
PDF
DSD-INT 2025 DevOps - Automated testing and delivery of Delft3D FM - van West...
PDF
IAAM Meetup #7 chez Onepoint - Construire un Rag-as-a-service en production. ...
PDF
Data Integration with Salesforce Bootcamp
PPTX
Performance Testing Transformation - LTB 2024
PDF
DSD-INT 2025 REACT - Rapid E-flow Assessment and Communication Tool - Flores
PDF
DSD-INT 2025 3D Modeling of Shallow Water Dynamics Using Delft3D FM - Martins
PPTX
Building a RAG System for Customer Support - L1
PDF
SCORM Cloud: The 5 categories of content distribution
PPTX
Key Benefits of Odoo Customization Services
PDF
Presentation Empowerment Technology in ICT
PDF
SWEBOK: the software engineering body of knowledge (SC25 Workshop Research So...
DSD-INT 2025 Modernizing Hydrodynamics in Large Flood Forecasting System - Mi...
DSD-INT 2025 Thermal and chemical plumes of sea cooling water from PEM platfo...
DSD-INT 2025 Delft3D FM Suite 2026.01 2D3D - New features + Improvements - Sp...
2025_11_19 - OpenMetadata Community Meeting.pdf
DSD-INT 2025 Next-Generation Flood Inundation Mapping for Taiwan - Challenges...
DSD-INT 2025 Transport and Fate of Microplastics in Fluvial System (Rhine Riv...
DevOps Monitoring Tools: The 2025 Guide to Performance & Observability
DSD-INT 2025 From Software to Impact - Water Quality Modelling for the UN Oce...
ECFT Case Study: Digital Pilot Transportation System
DSD-INT 2025 DevOps - Automated testing and delivery of Delft3D FM - van West...
IAAM Meetup #7 chez Onepoint - Construire un Rag-as-a-service en production. ...
Data Integration with Salesforce Bootcamp
Performance Testing Transformation - LTB 2024
DSD-INT 2025 REACT - Rapid E-flow Assessment and Communication Tool - Flores
DSD-INT 2025 3D Modeling of Shallow Water Dynamics Using Delft3D FM - Martins
Building a RAG System for Customer Support - L1
SCORM Cloud: The 5 categories of content distribution
Key Benefits of Odoo Customization Services
Presentation Empowerment Technology in ICT
SWEBOK: the software engineering body of knowledge (SC25 Workshop Research So...
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