A useful testing technique to find deadlocks related to invokeAndWait

; Date: Thu Jan 19 2006

Tags: Java

Tom Hawtin writes about (web.archive.org) a deadlock he found in jedit 4.2. As he says: There was, however, a use of invokeAndWait. Sure enough the EDT was waiting on monitor locked by the thread calling invokeAndWait.

What's most interesting is a class he provides to help one automatically find those situations. It relies on a Mustang ability provided through the JMX support to query all held locks. The code looks to see if the Event Dispatch Thread is called with a parent stack frame in invokeAndWait, and then checks the locks. Really cool.

Source: (web.archive.org) weblogs.java.net


See also " (web.archive.org) Automatically detecting AWT event dispatch thread hangs"

Posted by: coxcu on January 30, 2006 at 03:30 PM

About the Author(s)

David Herron : David Herron is a writer and software engineer focusing on the wise use of technology. He is especially interested in clean energy technologies like solar power, wind power, and electric cars. David worked for nearly 30 years in Silicon Valley on software ranging from electronic mail systems, to video streaming, to the Java programming language, and has published several books on Node.js programming and electric vehicles.