Gerrit, Dirk, Marcus, and Allen:

Thanks very much for the rapid replies. This is working like a charm.
Fortunately, there are thread creation callback hooks in the software
creating the external thread, so I am set. What a great way to get my day
started. =)

 -Patrick

Gerrit Voss wrote:
> Hi,
> 
> On Tue, 2005-10-04 at 09:12 -0500, Patrick Hartling wrote:
> 
>>Last night, I ran into a rather tricky problem with OpenSG and threading. I
>>have a multi-threaded application where the bulk of the work is in one
>>thread: the frame loop. (If it makes any difference, the frame loop is not
>>in the primordial thread--VR Juggler is involved.) This is where
>>OSG::osgInit(), OSG::osgExit(), and everything in between are being called.
>>In extending this application, there now exists the potential for an
>>externally spawned thread (i.e., a thread not created by OSG::ThreadManager)
>>to try to access scene graph data. This fails, to the best of my
>>understanding, because there is no aspect for the externally spawned thread.
>>
>>Do I have any OpenSG-friendly ways of dealing with this situation? 
> 
> 
> yes.
> 
> 
>>The effectiveness and simplicity of my whole plan for this software hinges on
>>being able to access scene graph data directly from the externally spawned
>>thread, so I am highly motivated to get this working [*]. From reading the
>>documentation, I understand that there are always two aspects created, and
>>that is exactly how many I need. Is there some way that I can have that
>>externally spawned thread hook up with the second aspect even though the
>>thread is not created by OpenSG?
> 
> 
> OSG::ExternalThread *_pLocalThread = OSG::ExternalThread  ::get(NULL);
> 
> _pLocalThread->initialize(AspectToUse);
> 
> regards,
>    gerrit
> 
> PS: please don't asked why this is not inside the documentation.
> 
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by:
> Power Architecture Resource Center: Free content, downloads, discussions,
> and more. http://solutions.newsforge.com/ibmarch.tmpl
> _______________________________________________
> Opensg-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/opensg-users


-- 
Patrick L. Hartling                    | VP Engineering, Infiscape Corp.
PGP: http://tinyurl.com/2msw3          | http://www.infiscape.com/

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to