Hi,

On Fri, 2005-03-04 at 05:35 -0600, Dirk Reiners wrote:
>       Hi Marcus,
> 
> On Fri, 2005-03-04 at 14:52 +0100, Marcus Lindblom wrote:
> > Hi,
> > 
> > but have found that it's quite picky about 
> > it's threads.
> 
> True.

> > This would not be a big problem, since I've managed to derive from 
> > ExternalThread and call intialize() to set an aspect to use for threads 
> > created in java, so initialization and rendering works just fine.
> 
> OK.
>
>
> > However, during exit, when the process dies, the C-runtime system 
> > deletes all global/class-static data in the OpenSG-dll, and this seem to 
> > be done in a thread which has not been initialized (and does not go 
> > through any of my code).
> 
> ARGL. Don't you just love Windows?
> 
> > I suppose the solution would be to correctly handle the 
> > DLL_THREAD_ATTACH and DLL_THREAD_DETACH in the DllMain() function of 
> > each DLL. This would allow OpenSG to initialize its thread-local data 
> > for all threads being called (either defaulting to one aspect, or using 
> > some dummy null-aspect, or something). Also, thread detaching would 
> > correctly. However, I have only some experience with DLL's and threading 
> > in windows (or at all), so there may be a better way to solve this.
> > 
> > Is this something someone has thought about, had experience with or 
> > solved already, I'd be very grateful to hear what you have to say.

Windows can be quite picky, just a short question to start with,
do you link against OpenSG or is OpenSG completely pulled in via
LoadLibrary. The second one is more tricky, if you do this  
could you try to build OpenSG using the --enable-win-localstorage
option. IIRC the __declspec(thread) we work with used to work only 
if the dll in question is directly linked into the program and not
loaded during runtime. I haven't check if this changed recently.
This is what people used to build an ActiveX OpenSG plugin for
one of the windows browsers (IIRC) which loaded OpenSG at runtime.

I don't know enough how java interacts with the c subsystem but I guess
this is not a Window problem on its own, this seem to be an interesting
combination with the java vm. Is there any good description out there
describing what is happening in this case ??. BTW which tools (java) do
you use ?. I'll see if we can switch to DLL_THREAD_ATTACH and
DLL_THREAD_DETACH but this might take a while to evaluate.

regards,
  gerrit


regards,
  gerrit




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to