What is a deadlock?
When writing multi-threaded applications, one of the most common problems experienced are deadlocks.
My questions to the community are:
-
What is a deadlock?
-
How do you detect them?
-
Do you handle them?
Multi-threading
Operating System
- asked 8 years ago
- B Butts
1Answer
A deadlock is a condition that occurs when two threads or processes wait for each other to complete the task. They will only hang up but never stop or finish their task. In computer science, deadlocks can be seen everywhere. In a transaction database, when two processes each within its own transaction update the same two rows of information but in the opposite order, will cause a deadlock. In concurrent programming, a deadlock may occur when two competing actions will wait for each other to proceed forward. In telecommunications systems, a deadlock can happen due to loss or corruption of signals.
At present, deadlock is one of the main problems in multiprocessing systems and parallel computing. As a solution, a locking system called process synchronization is implemented for software as well as hardware.
- answered 8 years ago
- Gul Hafiz
Your Answer