activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicky Sandhu <>
Subject Deadlocks again :(
Date Wed, 17 Oct 2007 21:40:59 GMT

Hi folks,
 I got hit by another deadlock condition. Thats two different ones on two
consecutive days :(

In ActiveMQ I see a lot of blocks of code using synchronized access, nothing
wrong with that but this increases the potential for deadlocks as evidenced
by the last two problems I have hit within the span of a couple of days

This may be just my luck but I think it points to concurrency 101 lessons
some which are a.) Lock on the appropriate object 2.) don't hold locks for
longer than absolutely necessary 3.) avoid nested locks like the plague. 4.)
Establish locking order for nested locks etc.



BTW. JConsole has a cool detect deadlock feature in jdk6 which makes this
exercise quick (once you stumble across the deadlock that is >:)) + this
article ( has code that
you can run periodically to dump them when they happen... something to be
included in perhaps a debug version to help root all these out ?
View this message in context:
Sent from the ActiveMQ - Dev mailing list archive at

View raw message