Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [udig-devel] uDig shutdown & threads

Jesse Eichar wrote:

I dont' really have a good answer here. I suppose that is one option you have. Let me know if you come up with a better solution. I'm interested in similar issues.

The framework is cruel, cruel, cruel. It will refuse to load plug-ins that try and do work during construction for example (it times them and kills the tread if you take too long).

I imagine it does the same thing on shutdown: I would not be surprised if waiting does not help.

I assume you are doing something like IO during shutdown, or cleaning up after a heavy UI Widget (Java3D?).
The basic plugin docs do have an IO example:
- http://publib.boulder.ibm.com/infocenter/wsphelp/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/org/eclipse/core/runtime/Plugin.html
http://publib.boulder.ibm.com/infocenter/wsphelp/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/core/runtime/Plugin.html#shutdown()

Yep it will terminate if you try and do any work :-( What resources are you trying to hold? Is there a chance you could associate them with your view and/or editor instead? I belive that dispose() is granted a bit more time. This does fall into the evil hack category...

Jody


Jesse

Vincent Nouguier wrote:

Hi,

I have a few threads running that haved to be stopped cleanly at shutdown.
They execute infinite loop that I break on MyPlugin.stop().
My problem is that they need some time to stop cleanly and that the framework doesn't let them this time. Is there a good practice to ensure that the framework will wait for my threads ? My first idea is to wait in the MyPlugin.stop() method until the end of the last thread. Is it a good idea ?

Vincent
_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel


_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel




Back to the top