随笔 - 54  文章 - 0  评论 - 6  阅读 - 68014

死锁问题

问题

  Dead lock in our App under some condition.  Both database and application lock contributes to issue.

  The issue could be simplified to following model.

  Thread 1:   Acquired DB Lock------------------||---------Try to get Application lock

  Thread 2:   Acquire Application lock------------||-----------Try to get DB locK

 

  The things I want to highlight is that when we implement functions in multi-thread ENV.

  we should not only pay attention to the lock explicitly invoked in our code but also the External Lock, eg: DML lock in this case.

解决

  将get DB lock代码放在Application lock范围之中

posted on   lpthread  阅读(200)  评论(0编辑  收藏  举报
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示