deadlock detection

Boehm, Hans hans_boehm@hp.com
Mon Sep 8 16:53:00 GMT 2003


> -----Original Message-----
> From: Jacob Gladish [mailto:gladish@spinnakernet.com]
>> > Boehm, Hans writes:
> > > It seems to me that the result is still quite limited 
> though, since
> > > it only detects deadlocks involving exclusively locks, as opposed
> > > to wait/notify or more obscure dependencies (IO, wait loops on
> > > volatiles, etc.) My guess is that this covers around 
> half the half
> > > the Java deadlocks I've seen, though my experience may 
> > > be atypical.
> I hadn't considered the ability to do any analysis other then 
> exclusive
> locks. Do any other java implementations attempt to do this?
>I don't think that's really possible. If you're
waiting with Object.wait(), you really don't know which thread you're
waiting for. (I guess you can detect if all threads are waiting on a lock
or untimed Object.wait(), but I suspect there are usually daemon threads
around that wake up occasionally even if the application is really completely
deadlocked.)
Probably the best you can do for the more complex deadlocks is to
print a description of what each thread is waiting on, and let the
programmer decide if there is a deadlock.
Hans


More information about the Java mailing list

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