Login  Register

Re: JOGL commit 166e5da causes deadlock errors in Java 3D

Posted by Sven Gothel on Jan 27, 2014; 1:02pm
URL: https://forum.jogamp.org/JOGL-commit-166e5da-causes-deadlock-errors-in-Java-3D-tp4031305p4031380.html

On 01/24/2014 06:11 PM, Julien [via jogamp] wrote:
> Sven,
>
> Thanks for looking into this.
>
> I cloned and built the latest jogl/gluegen/joal from github and I still see
> the deadlock problem. Note this happening on all platforms, not just OS X. You
> are correct, we are probably not making adequate use of the AWT-EDT.
>

"we" -> maybe Java3D ..

The AWTTreeLock is acquired by Component.removeHierarchyListener
and as for _every_ AWT component, modifications shall happen on the AWT-EDT.

IMHO the Canvas3D shall offload AWT modifications to the AWT-EDT
similar to what JOGL's GLCanvas and NEWTCanvasAWT does.

However, since JAWTWindow also represents a NativeWindow instance
it would not be too bad to offload AWTTreeLock methods ourselves, i.e.:

  boolean wait = false;
  AWTEDTExecutor.singleton.invoke(wait, new Runnable() {
      @Override
      public void run() {
          ... detach ..
      } } );

Accepted as filed under Bug 952:
   <https://jogamp.org/bugzilla/show_bug.cgi?id=952>

Thank you and Emmanual (who referenced this issue).

~Sven

+++

"J3D-Renderer-1" prio=5 tid=0x00007f96dceaf800 nid=0xe103 waiting for monitor entry [0x000000011d9d5000]
   java.lang.Thread.State: BLOCKED (on object monitor)
        at java.awt.Component.removeHierarchyListener(Component.java:5383)
        - waiting to lock <0x00000007f8127338> (a java.awt.Component$AWTTreeLock)
        at com.jogamp.nativewindow.awt.JAWTWindow$JAWTComponentListener.detach(JAWTWindow.java:175)
        at com.jogamp.nativewindow.awt.JAWTWindow$JAWTComponentListener.access$600(JAWTWindow.java:123)
        at com.jogamp.nativewindow.awt.JAWTWindow.destroy(JAWTWindow.java:606)
        at javax.media.j3d.JoglDrawable.destroyNativeWindow(JoglDrawable.java:60)
        at javax.media.j3d.JoglPipeline.destroyContext(JoglPipeline.java:6799)
        at javax.media.j3d.Canvas3D.destroyContext(Canvas3D.java:4651)
        at javax.media.j3d.Renderer.removeCtx(Renderer.java:1551)
        - locked <0x00000007f841de58> (a java.lang.Object)
        at javax.media.j3d.Renderer.doWork(Renderer.java:372)
        at javax.media.j3d.J3dThread.run(J3dThread.java:271)


+++


> Thanks again.
>
> -Julien
>


signature.asc (894 bytes) Download Attachment