[concurrency-interest] Deadlock detection

Oliver Zeigermann oliver at zeigermann.de
Fri Apr 6 12:35:14 EDT 2007


Folks!

I plan to write some code for deadlock detection for Java programming
using the concurrent package introduced in Java 1.5.

The code is intended for a new version of

http://jakarta.apache.org/commons/transaction/

and there to replace the old code which is described in

http://jakarta.apache.org/commons/transaction/locks/deadlock.html

I doubt that the idea and code described there are especially good and
would be pleased if anyone could point me to a better direction.

I was especially concerned about
 *  whether a check for a deadlock with potentially every locking
request really is a good idea or if it is smarter to let an additional
thread check for deadlocks from time to time, and
 * if there is any algorithm that does not have to check the whole
dependency graph for cycles, and
 * a more elegant version of the existing code could be written that
does not have the drawback of potentially rolling back both threads
that are part of a deadlock (one should be enough)

That code has been written by me, so if you want to comment, please do
not be polite ;)

Thanks for any hints in advance and cheers

Oliver


More information about the Concurrency-interest mailing list