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