Deadlock
What is Deadlock?
A deadlock is a situation in a computer system where two or more processes are blocked indefinitely, each waiting for the other to release a resource.
Causes of Deadlock
- Mutual Exclusion: Two or more processes require exclusive access to a resource.
- Hold and Wait: A process holds a resource and waits for another resource.
- No Preemption: A resource cannot be taken away from a process.
- Circular Wait: A process waits for a resource held by another process, which in turn waits for a resource held by the first process.
Effects of Deadlock
- System becomes unresponsive.
- Processes are blocked indefinitely.
- System resources are wasted.
Methods to Handle Deadlock
- Deadlock Prevention: Prevent deadlocks by ensuring that one of the necessary conditions is not met.
- Deadlock Avoidance: Avoid deadlocks by using algorithms that predict whether a deadlock is possible.
- Deadlock Detection: Detect deadlocks and recover from them.
- Deadlock Recovery: Recover from deadlocks by aborting processes or rolling back to a safe state.
No comments:
Post a Comment