Skip to main content

Strange deadlocks when reloading applets

1 reply [Last post]
oliverdb
Offline
Joined: 2005-02-10
Points: 0

Hello

We are running Scenegraph at a rather large site, and have been converting some of our applets to scenegraph. We moticed that if you reload the applet while a clip is running one would get deadlocks, quite easily.

Is there anything I can do except from getting the 0.6 code and trying to fix the deadlock myself

=============================
"AWT-EventQueue-6":
waiting to lock monitor 0x01b8da9c (object 0x244c5fc8, a com.sun.scenario.animation.MasterTimer$MainLoop),
which is held by "AWT-EventQueue-4"
"AWT-EventQueue-4":
waiting to lock monitor 0x042f8e24 (object 0x244c6028, a java.lang.Object),
which is held by "AWT-EventQueue-6"
Java stack information for the threads listed above:
===================================================
"AWT-EventQueue-6":
at com.sun.scenario.animation.MasterTimer$MainLoop.setJobsReady(ProWag:384)
- waiting to lock <0x244c5fc8> (a com.sun.scenario.animation.MasterTimer$MainLoop)
at com.sun.scenario.animation.MasterTimer.timePulseImpl(ProWag:449)
at com.sun.scenario.animation.MasterTimer.timePulse(ProWag:407)
at com.sun.scenario.animation.MasterTimer$MainLoop.run(ProWag:355)
at com.sun.scenario.scenegraph.SGEventQueue.doPulse(ProWag:475)
- locked <0x244c6028> (a java.lang.Object)
at com.sun.scenario.scenegraph.SGEventQueue.access$000(ProWag:65)
at com.sun.scenario.scenegraph.SGEventQueue$1.actionPerformed(ProWag:78)
at javax.swing.Timer.fireActionPerformed(Unknown Source)
at javax.swing.Timer$DoPostEvent.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
"AWT-EventQueue-4":
at com.sun.scenario.scenegraph.SGEventQueue.setAnimationRunnable(ProWag:485)
- waiting to lock <0x244c6028> (a java.lang.Object)
at com.sun.scenario.scenegraph.SwingGlueLayer.setAnimationRunnable(ProWag:126)
at com.sun.scenario.animation.MasterTimer$MainLoop.updateAnimationRunnable(ProWag:395)
- locked <0x244c5fc8> (a com.sun.scenario.animation.MasterTimer$MainLoop)
at com.sun.scenario.animation.MasterTimer$MainLoop.setClipsReady(ProWag:379)
- locked <0x244c5fc8> (a com.sun.scenario.animation.MasterTimer$MainLoop)
at com.sun.scenario.animation.MasterTimer.timePulseImpl(ProWag:416)
- locked <0x244c6190> (a com.sun.scenario.animation.RunQueue)
at com.sun.scenario.animation.MasterTimer.timePulse(ProWag:407)
at com.sun.scenario.animation.MasterTimer$MainLoop.run(ProWag:355)
at com.sun.scenario.scenegraph.SGEventQueue.doPulse(ProWag:475)
- locked <0x24242640> (a java.lang.Object)
at com.sun.scenario.scenegraph.SGEventQueue.access$000(ProWag:65)
at com.sun.scenario.scenegraph.SGEventQueue$1.actionPerformed(ProWag:78)
at javax.swing.Timer.fireActionPerformed(Unknown Source)
at javax.swing.Timer$DoPostEvent.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Found 1 deadlock.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
mortennobel
Offline
Joined: 2004-11-03
Points: 0

Hi Oliver

The scenegraph (and swing in general) does not support multithreading.
The threaddump you sent shows two event dispatcher threads (may caused by applets running simultaneously).

I think that the problem is related to shutting down the event dispatcher thread (or unhooking the scenegraph animation) before a new event dispatcher is created (with a new scenegraph animation).

- Morten