Deadlock in Parallel and
Distributed Computing
Course Name : Parallel and distributed computing
Course Code : CSE21856
Submitted To :
Debdutta Pal
Professor, Adamas University.
Submitted By :
Anupam Das
PG/SOET/210/24/003
Defining Deadlock: Circular Wait
The Core Concept
In a distributed system, deadlock refers to a situation where a set
of processes or threads are unable to proceed because each one is
waiting for a resource that is held by another process in the set.
Conditions for Deadlock
• Mutual exclusion: non-sharable resources.
• Hold and wait: holding resources while requesting
more.
• No preemption: resources cannot be forcibly taken.
• Circular wait: a circular chain of requests.
Real-World Deadlock Examples
Database Systems
Transactions wait for locks held by
others. This results in rollbacks,
impacting performance.
Operating Systems
Processes compete for memory,
files, and I/O. Resource contention
can lead to system stalls.
Distributed Systems
Services wait for responses in a
loop. This creates dependency
issues and downtime.
Deadlock Detection Methods
Resource Deadlock
Visual cycles show deadlock.
Communication Deadlock
Long waits for message
Line Lock
Cycle detection pinpoints deadlocks.
Deadlock Prevention
Strategies
Eliminate Mutual
Exclusion
Make resources
sharable.
Ordered Request
Requesting resource
should be less than
acquired process.
Process requests for all
the possible resources.
Collective Request
Deadlock Avoidance Techniques
1 Banker's Algorithm
Ensures a "safe state."
2 Resource Allocation
Graphs
Processes declare needs upfront.
3 Optimistic Approaches
Recover if deadlocks happen.
Strategies for Deadlock Recovery
1
Process Termination
Abort processes to free resources.
2
Resource Preemption
Take resources away from processes.
3
Rollback
Restore processes to a safe state.
Best Practices for Handling Deadlock
1
Design
Minimize contention with system and code review.
2
Lock Order
Prevent circular wait.
3
Timeouts
Detect deadlocks and trigger recovery.
4
Monitor
Track resource allocation for scenarios.
Thank You

Deadlock-in-Parallel-and-Distributed-Computing.pptx

  • 1.
    Deadlock in Paralleland Distributed Computing
  • 2.
    Course Name :Parallel and distributed computing Course Code : CSE21856 Submitted To : Debdutta Pal Professor, Adamas University. Submitted By : Anupam Das PG/SOET/210/24/003
  • 3.
    Defining Deadlock: CircularWait The Core Concept In a distributed system, deadlock refers to a situation where a set of processes or threads are unable to proceed because each one is waiting for a resource that is held by another process in the set. Conditions for Deadlock • Mutual exclusion: non-sharable resources. • Hold and wait: holding resources while requesting more. • No preemption: resources cannot be forcibly taken. • Circular wait: a circular chain of requests.
  • 4.
    Real-World Deadlock Examples DatabaseSystems Transactions wait for locks held by others. This results in rollbacks, impacting performance. Operating Systems Processes compete for memory, files, and I/O. Resource contention can lead to system stalls. Distributed Systems Services wait for responses in a loop. This creates dependency issues and downtime.
  • 5.
    Deadlock Detection Methods ResourceDeadlock Visual cycles show deadlock. Communication Deadlock Long waits for message Line Lock Cycle detection pinpoints deadlocks.
  • 6.
    Deadlock Prevention Strategies Eliminate Mutual Exclusion Makeresources sharable. Ordered Request Requesting resource should be less than acquired process. Process requests for all the possible resources. Collective Request
  • 7.
    Deadlock Avoidance Techniques 1Banker's Algorithm Ensures a "safe state." 2 Resource Allocation Graphs Processes declare needs upfront. 3 Optimistic Approaches Recover if deadlocks happen.
  • 8.
    Strategies for DeadlockRecovery 1 Process Termination Abort processes to free resources. 2 Resource Preemption Take resources away from processes. 3 Rollback Restore processes to a safe state.
  • 9.
    Best Practices forHandling Deadlock 1 Design Minimize contention with system and code review. 2 Lock Order Prevent circular wait. 3 Timeouts Detect deadlocks and trigger recovery. 4 Monitor Track resource allocation for scenarios.
  • 10.