SlideShare a Scribd company logo
DEADLOCK PREVENTION
AND AVOIDANCE
ASSIGNMENT SERIES - 75
7376212CB137 PUGALENTHI M S
INTRODUCTION
Deadlocks in computer systems refer to a situation where multiple processes are blocked because each
process is waiting for another process to release a resource it needs. This creates a vicious cycle where
none of the processes can continue executing. Deadlocks can occur in various types of computer systems,
including operating systems, databases, and distributed systems. Deadlock prevention is the process of
avoiding deadlocks in the system by designing the system in such a way that deadlocks cannot occur. This
can be achieved by implementing strict ordering rules for resource allocation, ensuring that processes
only request resources in a specific order. Another way to prevent deadlocks is by implementing a timeout
mechanism, where a process will release its resources after a certain time if it cannot acquire all the
resources it needs. Deadlock avoidance is the process of detecting potential deadlocks before they occur
and taking steps to prevent them. This can be achieved by dynamically allocating resources based on the
current state of the system, ensuring that the resources are always available to the processes that need
them. Another way to avoid deadlocks is by implementing a resource allocation graph, where processes
and resources are represented as nodes and the resource allocation relationship is represented as edges.
The resource allocation graph can be used to detect potential deadlocks and take steps to prevent them.
TECHNIQUES TO AVOID DEADLOCKS
1. Deadlock Prevention
2. Deadlock Avoidance
3. Deadlock Detection and Recovery
4. Deadlock Ignorance
DEADLOCK PREVENTION
• Deadlock prevention involves avoiding scenarios that can lead to deadlocks.
• One common technique is the use of resource ordering. In this method, resources
are acquired in a specific order to ensure that they are not requested
simultaneously by multiple processes.
• Another technique is the use of time-outs, in which a process will automatically
release a resource if it is not used within a specified time period.
DEADLOCK AVOIDANCE
• Deadlock avoidance is a proactive approach that uses algorithms to determine if a
deadlock is about to occur and takes measures to prevent it.
• There are two main approaches to deadlock avoidance:
1. The banker's algorithm: This is a resource-allocation algorithm that ensures that
a deadlock will never occur by keeping track of the resources currently being held by
each process and ensuring that a new resource allocation request can be safely
granted.
2. The wait-for graph: This approach involves constructing a graph that represents
the relationships between processes and resources, and checking the graph for cycles
to determine whether a deadlock is likely to occur. If a cycle is detected, the request for
a new resource allocation is rejected, preventing the deadlock.
DEADLOCK DETECTION AND RECOVERY
• Deadlock detection is a reactive approach that involves periodically checking for
deadlocks in the system. If a deadlock is detected, the system takes measures to
resolve the deadlock.
• There are two main approaches to deadlock detection and recovery:
1. Resource allocation graph: This approach involves constructing a graph that
represents the relationships between processes and resources, and checking the
graph for cycles to determine whether a deadlock has occurred. If a cycle is
detected, one of the processes involved in the deadlock is terminated to break
the cycle and allow the other processes to continue.
2. Wait-for timeout: This approach involves setting a timeout on a process
waiting for a resource. If the process takes too long to obtain the resource, it is
terminated, breaking the deadlock.
DEADLOCK IGNORANCE
• Deadlock ignorance is a technique used in computer science to handle deadlocks
in a
multitasking operating system, where the system simply ignores the existence of
deadlocks.
• This technique assumes that deadlocks will eventually resolve themselves, either
through the release of resources by one of the processes involved or through the
termination of one of the processes.
• The main advantage of deadlock ignorance is that it is the simplest approach to
handling deadlocks, as it requires no additional code or algorithms to detect or
recover from deadlocks.
• However, it also has several disadvantages, such as reduced system performance
and the possibility of a process remaining deadlocked indefinitely.
CONCLUSION
• In conclusion, deadlocks are a common problem in multitasking operating
systems, and various techniques have been developed to handle them.
• Deadlock prevention involves avoiding situations that could lead to a
deadlock, deadlock avoidance involves checking for potential conflicts before
allocating resources, deadlock detection and recovery involves periodically
checking for deadlocks and recovering from them by aborting one of the
processes involved, and deadlock ignorance involves simply ignoring the
existence of Deadlocks.
• Each of these techniques has its own advantages and disadvantages, and the
best approach depends on the specific requirements of the system.
THANK YOU!!

More Related Content

What's hot

8. mutual exclusion in Distributed Operating Systems
8. mutual exclusion in Distributed Operating Systems8. mutual exclusion in Distributed Operating Systems
8. mutual exclusion in Distributed Operating Systems
Dr Sandeep Kumar Poonia
 
Resource management
Resource managementResource management
Resource management
Dr Sandeep Kumar Poonia
 
Transport layer
Transport layerTransport layer
Transport layer
reshmadayma
 
Multi processor scheduling
Multi  processor schedulingMulti  processor scheduling
Multi processor scheduling
Shashank Kapoor
 
Deadlock detection & prevention
Deadlock detection & preventionDeadlock detection & prevention
Deadlock detection & prevention
IkhtiarUddinShaHin
 
data replication
data replicationdata replication
data replication
Hassanein Alwan
 
Process synchronization in Operating Systems
Process synchronization in Operating SystemsProcess synchronization in Operating Systems
Process synchronization in Operating Systems
Ritu Ranjan Shrivastwa
 
Deadlock Prevention
Deadlock PreventionDeadlock Prevention
Deadlock Prevention
prachi mewara
 
Distributed operating system
Distributed operating systemDistributed operating system
Distributed operating system
udaya khanal
 
Communication in Distributed Systems
Communication in Distributed SystemsCommunication in Distributed Systems
Communication in Distributed Systems
Dilum Bandara
 
Concurrency control
Concurrency controlConcurrency control
Concurrency control
Subhasish Pati
 
6.Distributed Operating Systems
6.Distributed Operating Systems6.Distributed Operating Systems
6.Distributed Operating Systems
Dr Sandeep Kumar Poonia
 
Deadlock
DeadlockDeadlock
Deadlock
Rajandeep Gill
 
Dead Lock
Dead LockDead Lock
Dead Lock
Ramasubbu .P
 
Deadlock- Operating System
Deadlock- Operating SystemDeadlock- Operating System
Deadlock- Operating System
Rajan Shah
 
Distributed system lamport's and vector algorithm
Distributed system lamport's and vector algorithmDistributed system lamport's and vector algorithm
Distributed system lamport's and vector algorithm
pinki soni
 
Inter Process Communication
Inter Process CommunicationInter Process Communication
Inter Process Communication
Adeel Rasheed
 
Distributed Mutual exclusion algorithms
Distributed Mutual exclusion algorithmsDistributed Mutual exclusion algorithms
Distributed Mutual exclusion algorithms
MNM Jain Engineering College
 

What's hot (20)

8. mutual exclusion in Distributed Operating Systems
8. mutual exclusion in Distributed Operating Systems8. mutual exclusion in Distributed Operating Systems
8. mutual exclusion in Distributed Operating Systems
 
Resource management
Resource managementResource management
Resource management
 
Transport layer
Transport layerTransport layer
Transport layer
 
Multi processor scheduling
Multi  processor schedulingMulti  processor scheduling
Multi processor scheduling
 
Deadlock detection & prevention
Deadlock detection & preventionDeadlock detection & prevention
Deadlock detection & prevention
 
data replication
data replicationdata replication
data replication
 
Process synchronization in Operating Systems
Process synchronization in Operating SystemsProcess synchronization in Operating Systems
Process synchronization in Operating Systems
 
Deadlock Prevention
Deadlock PreventionDeadlock Prevention
Deadlock Prevention
 
Distributed operating system
Distributed operating systemDistributed operating system
Distributed operating system
 
Communication in Distributed Systems
Communication in Distributed SystemsCommunication in Distributed Systems
Communication in Distributed Systems
 
Concurrency control
Concurrency controlConcurrency control
Concurrency control
 
6.Distributed Operating Systems
6.Distributed Operating Systems6.Distributed Operating Systems
6.Distributed Operating Systems
 
Deadlock
DeadlockDeadlock
Deadlock
 
Deadlock ppt
Deadlock ppt Deadlock ppt
Deadlock ppt
 
Dead Lock
Dead LockDead Lock
Dead Lock
 
Deadlock- Operating System
Deadlock- Operating SystemDeadlock- Operating System
Deadlock- Operating System
 
Distributed system lamport's and vector algorithm
Distributed system lamport's and vector algorithmDistributed system lamport's and vector algorithm
Distributed system lamport's and vector algorithm
 
Inter Process Communication
Inter Process CommunicationInter Process Communication
Inter Process Communication
 
Deadlock
DeadlockDeadlock
Deadlock
 
Distributed Mutual exclusion algorithms
Distributed Mutual exclusion algorithmsDistributed Mutual exclusion algorithms
Distributed Mutual exclusion algorithms
 

Similar to DEADLOCK PREVENTION AND AVOIDANCE.pptx

Unit 3 part 2(DEADLOCK)
Unit 3 part 2(DEADLOCK)Unit 3 part 2(DEADLOCK)
Unit 3 part 2(DEADLOCK)
WajeehaBaig
 
operating system
operating systemoperating system
operating system
renukarenuka9
 
operating system
operating systemoperating system
operating system
renukarenuka9
 
Os presentation final.pptxjjjjjdakajwsjjdhdfjff
Os presentation final.pptxjjjjjdakajwsjjdhdfjffOs presentation final.pptxjjjjjdakajwsjjdhdfjff
Os presentation final.pptxjjjjjdakajwsjjdhdfjff
ZeelGoyani
 
Deadlock in distribute system by saeed siddik
Deadlock in distribute system by saeed siddikDeadlock in distribute system by saeed siddik
Deadlock in distribute system by saeed siddikSaeed Siddik
 
OS 7.pptx
OS 7.pptxOS 7.pptx
OS 7.pptx
ZainabShahzad9
 
Deadlock Slides
Deadlock SlidesDeadlock Slides
Deadlock Slides
sehrishishaq1
 
Deadlock detection
Deadlock detectionDeadlock detection
Deadlock detection
Nadia Nahar
 
Chapter06.ppt
Chapter06.pptChapter06.ppt
Chapter06.ppt
AvadhRakholiya3
 
Operating system - Deadlock
Operating system - DeadlockOperating system - Deadlock
Operating system - Deadlock
Shashank Yenurkar
 
Rdbms
RdbmsRdbms
Deadlock and memory management -- Operating System
Deadlock and memory management -- Operating SystemDeadlock and memory management -- Operating System
Deadlock and memory management -- Operating System
EktaVaswani2
 
Overview of Deadlock unit 3 part 1
Overview of Deadlock unit 3 part 1Overview of Deadlock unit 3 part 1
Overview of Deadlock unit 3 part 1
Dr.M.Karthika parthasarathy
 
chapter06-new.pptx
chapter06-new.pptxchapter06-new.pptx
chapter06-new.pptx
Umesh Hengaju
 
Deadlock
DeadlockDeadlock
Deadlock
Mahershi ACT
 
4.3 Deadlock [Autosaved].pptx
4.3 Deadlock [Autosaved].pptx4.3 Deadlock [Autosaved].pptx
4.3 Deadlock [Autosaved].pptx
DishaDwivedi2
 
Deadlocks
DeadlocksDeadlocks
Deadlocks
Sakshi Tiwari
 
osvishal-160830131208 (1).pdf
osvishal-160830131208 (1).pdfosvishal-160830131208 (1).pdf
osvishal-160830131208 (1).pdf
amadayshwan
 
Deadlock
DeadlockDeadlock
Deadlock
VISHAL DONGA
 

Similar to DEADLOCK PREVENTION AND AVOIDANCE.pptx (20)

Unit 3 part 2(DEADLOCK)
Unit 3 part 2(DEADLOCK)Unit 3 part 2(DEADLOCK)
Unit 3 part 2(DEADLOCK)
 
operating system
operating systemoperating system
operating system
 
operating system
operating systemoperating system
operating system
 
Os presentation final.pptxjjjjjdakajwsjjdhdfjff
Os presentation final.pptxjjjjjdakajwsjjdhdfjffOs presentation final.pptxjjjjjdakajwsjjdhdfjff
Os presentation final.pptxjjjjjdakajwsjjdhdfjff
 
Deadlock in distribute system by saeed siddik
Deadlock in distribute system by saeed siddikDeadlock in distribute system by saeed siddik
Deadlock in distribute system by saeed siddik
 
OS 7.pptx
OS 7.pptxOS 7.pptx
OS 7.pptx
 
Deadlock Slides
Deadlock SlidesDeadlock Slides
Deadlock Slides
 
Deadlock detection
Deadlock detectionDeadlock detection
Deadlock detection
 
Chapter06.ppt
Chapter06.pptChapter06.ppt
Chapter06.ppt
 
Operating system - Deadlock
Operating system - DeadlockOperating system - Deadlock
Operating system - Deadlock
 
Rdbms
RdbmsRdbms
Rdbms
 
Deadlock and memory management -- Operating System
Deadlock and memory management -- Operating SystemDeadlock and memory management -- Operating System
Deadlock and memory management -- Operating System
 
Overview of Deadlock unit 3 part 1
Overview of Deadlock unit 3 part 1Overview of Deadlock unit 3 part 1
Overview of Deadlock unit 3 part 1
 
chapter06-new.pptx
chapter06-new.pptxchapter06-new.pptx
chapter06-new.pptx
 
Deadlock
DeadlockDeadlock
Deadlock
 
4.3 Deadlock [Autosaved].pptx
4.3 Deadlock [Autosaved].pptx4.3 Deadlock [Autosaved].pptx
4.3 Deadlock [Autosaved].pptx
 
Chapter06
Chapter06Chapter06
Chapter06
 
Deadlocks
DeadlocksDeadlocks
Deadlocks
 
osvishal-160830131208 (1).pdf
osvishal-160830131208 (1).pdfosvishal-160830131208 (1).pdf
osvishal-160830131208 (1).pdf
 
Deadlock
DeadlockDeadlock
Deadlock
 

Recently uploaded

FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
RinaMondal9
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
UiPathCommunity
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
Vlad Stirbu
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.
ViralQR
 

Recently uploaded (20)

FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.
 

DEADLOCK PREVENTION AND AVOIDANCE.pptx

  • 1. DEADLOCK PREVENTION AND AVOIDANCE ASSIGNMENT SERIES - 75 7376212CB137 PUGALENTHI M S
  • 2. INTRODUCTION Deadlocks in computer systems refer to a situation where multiple processes are blocked because each process is waiting for another process to release a resource it needs. This creates a vicious cycle where none of the processes can continue executing. Deadlocks can occur in various types of computer systems, including operating systems, databases, and distributed systems. Deadlock prevention is the process of avoiding deadlocks in the system by designing the system in such a way that deadlocks cannot occur. This can be achieved by implementing strict ordering rules for resource allocation, ensuring that processes only request resources in a specific order. Another way to prevent deadlocks is by implementing a timeout mechanism, where a process will release its resources after a certain time if it cannot acquire all the resources it needs. Deadlock avoidance is the process of detecting potential deadlocks before they occur and taking steps to prevent them. This can be achieved by dynamically allocating resources based on the current state of the system, ensuring that the resources are always available to the processes that need them. Another way to avoid deadlocks is by implementing a resource allocation graph, where processes and resources are represented as nodes and the resource allocation relationship is represented as edges. The resource allocation graph can be used to detect potential deadlocks and take steps to prevent them.
  • 3. TECHNIQUES TO AVOID DEADLOCKS 1. Deadlock Prevention 2. Deadlock Avoidance 3. Deadlock Detection and Recovery 4. Deadlock Ignorance
  • 4. DEADLOCK PREVENTION • Deadlock prevention involves avoiding scenarios that can lead to deadlocks. • One common technique is the use of resource ordering. In this method, resources are acquired in a specific order to ensure that they are not requested simultaneously by multiple processes. • Another technique is the use of time-outs, in which a process will automatically release a resource if it is not used within a specified time period.
  • 5. DEADLOCK AVOIDANCE • Deadlock avoidance is a proactive approach that uses algorithms to determine if a deadlock is about to occur and takes measures to prevent it. • There are two main approaches to deadlock avoidance: 1. The banker's algorithm: This is a resource-allocation algorithm that ensures that a deadlock will never occur by keeping track of the resources currently being held by each process and ensuring that a new resource allocation request can be safely granted. 2. The wait-for graph: This approach involves constructing a graph that represents the relationships between processes and resources, and checking the graph for cycles to determine whether a deadlock is likely to occur. If a cycle is detected, the request for a new resource allocation is rejected, preventing the deadlock.
  • 6. DEADLOCK DETECTION AND RECOVERY • Deadlock detection is a reactive approach that involves periodically checking for deadlocks in the system. If a deadlock is detected, the system takes measures to resolve the deadlock. • There are two main approaches to deadlock detection and recovery: 1. Resource allocation graph: This approach involves constructing a graph that represents the relationships between processes and resources, and checking the graph for cycles to determine whether a deadlock has occurred. If a cycle is detected, one of the processes involved in the deadlock is terminated to break the cycle and allow the other processes to continue. 2. Wait-for timeout: This approach involves setting a timeout on a process waiting for a resource. If the process takes too long to obtain the resource, it is terminated, breaking the deadlock.
  • 7. DEADLOCK IGNORANCE • Deadlock ignorance is a technique used in computer science to handle deadlocks in a multitasking operating system, where the system simply ignores the existence of deadlocks. • This technique assumes that deadlocks will eventually resolve themselves, either through the release of resources by one of the processes involved or through the termination of one of the processes. • The main advantage of deadlock ignorance is that it is the simplest approach to handling deadlocks, as it requires no additional code or algorithms to detect or recover from deadlocks. • However, it also has several disadvantages, such as reduced system performance and the possibility of a process remaining deadlocked indefinitely.
  • 8. CONCLUSION • In conclusion, deadlocks are a common problem in multitasking operating systems, and various techniques have been developed to handle them. • Deadlock prevention involves avoiding situations that could lead to a deadlock, deadlock avoidance involves checking for potential conflicts before allocating resources, deadlock detection and recovery involves periodically checking for deadlocks and recovering from them by aborting one of the processes involved, and deadlock ignorance involves simply ignoring the existence of Deadlocks. • Each of these techniques has its own advantages and disadvantages, and the best approach depends on the specific requirements of the system.

Editor's Notes

  1. In computer systems, deadlocks occur when multiple processes become blocked as each process waits for another to release a resource it requires. This creates a cycle where none of the processes can continue to function. Deadlocks can arise in various computer systems such as operating systems, databases, and distributed systems. To avoid deadlocks, the system can be designed in such a way that they cannot happen. This can be accomplished by implementing strict rules for allocating resources, which ensure processes only request resources in a set order. Another way to prevent deadlocks is by adding a timeout mechanism, where a process releases its resources after a certain period if it is unable to obtain the necessary resources. Deadlock avoidance, on the other hand, involves identifying potential deadlocks before they occur and taking steps to prevent them. This can be achieved through the dynamic allocation of resources based on the current state of the system, ensuring that resources are always available to the processes that require them. A resource allocation graph can also be used to detect and prevent deadlocks by representing processes and resources as nodes and the resource allocation relationship as edges. Both deadlock prevention and avoidance are crucial for maintaining the stability and performance of computer systems. Deadlocks can lead to data corruption, system crashes, and decreased performance, and by implementing these techniques, the likelihood of deadlocks can be reduced and the system can continue to operate efficiently and reliably.
  2. In computer systems, deadlocks occur when multiple processes become blocked as each process waits for another to release a resource it requires. This creates a cycle where none of the processes can continue to function. Deadlocks can arise in various computer systems such as operating systems, databases, and distributed systems. To avoid deadlocks, the system can be designed in such a way that they cannot happen. This can be accomplished by implementing strict rules for allocating resources, which ensure processes only request resources in a set order. Another way to prevent deadlocks is by adding a timeout mechanism, where a process releases its resources after a certain period if it is unable to obtain the necessary resources. Deadlock avoidance, on the other hand, involves identifying potential deadlocks before they occur and taking steps to prevent them. This can be achieved through the dynamic allocation of resources based on the current state of the system, ensuring that resources are always available to the processes that require them. A resource allocation graph can also be used to detect and prevent deadlocks by representing processes and resources as nodes and the resource allocation relationship as edges. Both deadlock prevention and avoidance are crucial for maintaining the stability and performance of computer systems. Deadlocks can lead to data corruption, system crashes, and decreased performance, and by implementing these techniques, the likelihood of deadlocks can be reduced and the system can continue to operate efficiently and reliably.