Re: Off screen finalization

Hi Santiago,

Thanks for the list of threads. None of them are VisAD
threads, but many of them belong to Java3D. Note Kevin
Rushforth, Sun's main Jav3D developer, has recently
addressed this issue at:

  http://javadesktop.org/forums/thread.jspa?messageID=37181

In one message, he describes the proper procedure for
stopping Java3D threads. We follow this procedure in
the destroy() method in visad.java3d.UniverseBuilderJ3D,
except that we have commmented out:

  view.attachViewPlatform(null);

because it was throwing a NullPointerException. That
situation may have changed with more recent Java3D
versions. Perhaps you or someone else with this
problem can experiment with our

  visad.java3d.UniverseBuilderJ3D.destroy()

method.

Note that in another recent message, Kevin says there
is a bug in Java3D that makes it impossible to stop
all Java3D threads. Until that bug is fixed, it may not
be possible to stop all Java3D threads without calling
System.exit().

If anyone experiments with our UniverseBuilderJ3D.destroy()
method, please let us know what you find. I will be
travelling until 6 Feb.

Cheers,
Bill

On Tue, 18 Jan 2005, S Santos wrote:

> Hi Bill,
>
>  Here are the jdb traces after the destroy and stopThreadPool:
>
> Executing the command 'threads'
>
> > threads
> Group system:
>   (java.lang.ref.Reference$ReferenceHandler)0x10e Reference Handler
> cond. waiting
>   (java.lang.ref.Finalizer$FinalizerThread)0x10d  Finalizer
> cond. waiting
>   (java.lang.Thread)0x10c                         Signal Dispatcher
> running
> Group main:
>   (java.lang.Thread)0x2d9                         AWT-Windows
> running
>   (java.lang.Thread)0x379                         Java2D Disposer
> cond. waiting
>   (java.lang.Thread)0x542                         DestroyJavaVM
> running
> Group Java3D:
>   (javax.media.j3d.StructureUpdateThread)0x395
> J3D-RenderingAttributesStructureUpdateThread    cond. waiting
>   (javax.media.j3d.TimerThread)0x39c              J3D-TimerThread
> cond. waiting
>   (javax.media.j3d.MasterControlThread)0x39d      J3D-MasterControl
> cond. waiting
>   (javax.media.j3d.Renderer)0x3a7                 J3D-Renderer-1
> cond. waiting
>   (javax.media.j3d.StructureUpdateThread)0x41d
> J3D-BehaviorStructureUpdateThread-1             cond. waiting
>   (javax.media.j3d.StructureUpdateThread)0x41e
> J3D-GeometryStructureUpdateThread-1             cond. waiting
>   (javax.media.j3d.StructureUpdateThread)0x41f
> J3D-SoundStructureUpdateThread-1                cond. waiting
>   (javax.media.j3d.StructureUpdateThread)0x420
> J3D-RenderingEnvironmentStructureUpdateThread-1 cond. waiting
>   (javax.media.j3d.StructureUpdateThread)0x421
> J3D-TransformStructureUpdateThread-1            cond. waiting
>   (javax.media.j3d.BehaviorScheduler)0x424        J3D-BehaviorScheduler-1
> cond. waiting
>   (javax.media.j3d.StructureUpdateThread)0x425
> J3D-RenderStructureUpdateThread-1               cond. waiting
>   (javax.media.j3d.StructureUpdateThread)0x426
> J3D-SoundSchedulerUpdateThread-1                cond. waiting
>   (javax.media.j3d.InputDeviceScheduler)0x429     J3D-InputDeviceScheduler-1
> cond. waiting
>
> Executing the command 'where all'
>
> > where all
> Signal Dispatcher:
> Current thread isn't suspended.
> Finalizer:
> Current thread isn't suspended.
> Reference Handler:
> Current thread isn't suspended.
> AWT-Windows:
> Current thread isn't suspended.
> Java2D Disposer:
> Current thread isn't suspended.
> J3D-RenderingAttributesStructureUpdateThread:
> Current thread isn't suspended.
> J3D-TimerThread:
> Current thread isn't suspended.
> J3D-MasterControl:
> Current thread isn't suspended.
> J3D-Renderer-1:
> Current thread isn't suspended.
> J3D-BehaviorStructureUpdateThread-1:
> Current thread isn't suspended.
> J3D-GeometryStructureUpdateThread-1:
> Current thread isn't suspended.
> J3D-SoundStructureUpdateThread-1:
> Current thread isn't suspended.
> J3D-RenderingEnvironmentStructureUpdateThread-1:
> Current thread isn't suspended.
> J3D-TransformStructureUpdateThread-1:
> Current thread isn't suspended.
> J3D-BehaviorScheduler-1:
> Current thread isn't suspended.
> J3D-RenderStructureUpdateThread-1:
> Current thread isn't suspended.
> J3D-SoundSchedulerUpdateThread-1:
> Current thread isn't suspended.
> J3D-InputDeviceScheduler-1:
> Current thread isn't suspended.
> DestroyJavaVM:
> Current thread isn't suspended.
>
> Cheers,
>
> Santi.
>
>
> ----- Original Message -----
> From: "Bill Hibbard" <billh@xxxxxxxxxxxxx>
> To: "S Santos" <s.santos@xxxxxxxxx>
> Cc: <visad@xxxxxxxxxxxxxxxx>
> Sent: Tuesday, January 18, 2005 5:30 PM
> Subject: Re: Off screen finalization
>
>
> > Santiago,
> >
> >> I tried visad-2.0 and the exception dissapear but some of the threads
> >> that
> >> VisAD open with the DisplayImplJ3D continue their execution. So the
> >> program
> >> doesn't finish.
> >>
> >>  Is there any way to clear those threads without using System.exit() in
> >> main
> >> method?
> >
> > Can you supply us with the names of the threads that
> > continue execution? A 'where all' in jdb should give
> > you the names of all running threads.
> >
> > Thanks,
> > Bill
> >
> >
>
>