What are common reasons for deadlocks?

后端 未结 12 1014
清酒与你
清酒与你 2020-12-13 00:16

Deadlocks are hard to find and very uncomfortable to remove.

How can I find error sources for deadlocks in my code? Are there any \"deadlock patterns\"?

In m

12条回答
  •  感动是毒
    2020-12-13 00:56

    Yes - deadlocks occur when processes try to acquire resources in random order. If all your processes try to acquire the same resources in the same order, the possibilities for deadlocks are greatly reduced, if not eliminated.

    Of course, this is not always easy to arrange...

提交回复
热议问题