Ways to detect deadlock in a live application
问题 What are the ways to detect deadlocks in a live multi-threaded application? If we found there is a deadlock, are there any ways to resolve it, without taking down/restarting the application? 回答1: There are two popular ways to detect deadlocks. One is to have threads set checkpoints. For example, if you have a thread that has a work loop, you set a timer at the beginning of doing work that's set for longer than you think the work could possibly take. If the timer fires, you assume the thread