R
Rogan Dawes
Hi folks,
Being a fairly novice Java programmer, I am sure that I make many
mistakes in my coding.
One of the problems that I have encountered is deadlocks between my
application code and the Swing/AWT event thread. I am obviously trying
to synchronize() or wait() on the same object, and so the GUI stops
responding.
This is not strictly a Swing question, though, so I am posting it here
rather than c.l.j.g.
Is it possible for the JVM to print out a list of threads that are
waiting on the same semaphore/lock? I have seen references to the
HotSpot VM being able to do this, but was not able to see how to get
this to work.
I have also seen such functionality in NetBeans, running under the
debugger, where it can show you the contested lock, the threads that are
contesting it, and the stack trace for each thread showing how it got to
that point. This is exactly what I am looking for, in a slightly lighter
weight form.
Does anyone know of a debugger that would dump such information
(contested object, thread names and stack traces) when it detects this
condition? This could be helpful for both myself, and other users of my
app, in formulating bug reports or fixing the bugs themselves.
I'm kind of envisioning the following:
$ deadlockmonitor -jar myapp.jar
Deadlock detected on object ArrayList@123abc
Threads:
AWT-EventQueue-0
main
StackTraces:
AWT-EventQueue-0:
[... a stack trace ....]
main:
[... a stack trace ....]
Many thanks
Rogan
Being a fairly novice Java programmer, I am sure that I make many
mistakes in my coding.
One of the problems that I have encountered is deadlocks between my
application code and the Swing/AWT event thread. I am obviously trying
to synchronize() or wait() on the same object, and so the GUI stops
responding.
This is not strictly a Swing question, though, so I am posting it here
rather than c.l.j.g.
Is it possible for the JVM to print out a list of threads that are
waiting on the same semaphore/lock? I have seen references to the
HotSpot VM being able to do this, but was not able to see how to get
this to work.
I have also seen such functionality in NetBeans, running under the
debugger, where it can show you the contested lock, the threads that are
contesting it, and the stack trace for each thread showing how it got to
that point. This is exactly what I am looking for, in a slightly lighter
weight form.
Does anyone know of a debugger that would dump such information
(contested object, thread names and stack traces) when it detects this
condition? This could be helpful for both myself, and other users of my
app, in formulating bug reports or fixing the bugs themselves.
I'm kind of envisioning the following:
$ deadlockmonitor -jar myapp.jar
Deadlock detected on object ArrayList@123abc
Threads:
AWT-EventQueue-0
main
StackTraces:
AWT-EventQueue-0:
[... a stack trace ....]
main:
[... a stack trace ....]
Many thanks
Rogan