如何检测并发现程序处于死锁状态? [英] How to detect and find out a program is in deadlock?
本文介绍了如何检测并发现程序处于死锁状态?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是一个面试问题.
如何检测并找出程序是否处于死锁状态?在Linux/Unix系统上是否可以使用某些工具来做到这一点?
How to detect and find out if a program is in deadlock? Are there some tools that can be used to do that on Linux/Unix systems?
我的想法:
如果程序没有任何进展并且其状态正在运行,则说明它处于死锁状态.但是,其他原因也会导致此问题.开源工具valgrind(halgrind)可以做到这一点.正确的?
If a program makes no progress and its status is running, it is deadlock. But, other reasons can also cause this problem. Open source tools are valgrind (halgrind) can do that. Right?
推荐答案
查看全文