deadlock detection

Andrew Haley aph@redhat.com
Fri Sep 5 16:45:00 GMT 2003


Jacob Gladish writes:
 > 
 > And I'll second that vouch. We have an application with a large number
 > of threads, and deadlocking the system is very easy to when a developer
 > is even slightly careless with synchronized blocks. A simple singal to
 > report the deadlocked condition would have saved us many hours of
 > pouring over thread dumps.
 > 
 > Maybe this could be something for me to contribute to the 3.3+ line.
This would be a useful addition to gcj.
 > Is anyone interested in an offline discussion on this?
Yes, but I don't think it's necessary to take the discussion offline.
However, if that's what you want I'll gladly go along with your
wishes.
My understanding is that deadlock detection can be done with a
resource-allocation graph algorithm; you have to look for cycles in
the graph. Given that every synchronization calls _Jv_MonitorEnter,
it should be fairly easy to build such a graph. There's code to do
that here:
http://www.phfactor.net/code/dldet/
http://www.phfactor.net/code/dldet/deadlock.zip
On a related matter, there's an interesting paper at
http://www.acm.org/crossroads/xrds4-2/dynac.html.
Andrew.


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /