Ok, I did that and it seems to be working. Using an update callback keeps
the setText() calls in the main thread and I think that's what was nuking
my stuff. Thanks!
- Steve
On Wed, 3 Jan 2007, Steve Webb wrote:
Date: Wed, 3 Jan 2007 13:36:51 -0700 (MST)
From: Steve Webb <[EMAIL PROTECTED]>
Reply-To: osg users <[email protected]>
To: osg users <[email protected]>
Subject: Re: [osg-users] Segfaulting somewhere in osgText
The setText is being called from the second thread. Is there some
semaphore that I need to call to pause the rendering thread until my
second thread is done with all of the setText()'s?
There is no thread safety in osgText for this type of usage, as with
the rest of the OSG is designed to updated during the update phase
*not* the cull and draw phases.
If we wish to do this then you'll need to carefully manage the updates
using your own mutexes. Other select parts of the OSG do this, but
this kept very local and specific to avoid the performance penalty
associcated with protecting all ops with mutexes.
How about then I just update some character arrays instead and have OSG just
update the text nodes based on that when it updates by itself? If I add an
UpdateCallback to the text nodes, will that work?
- Steve
--
EMAIL: (h) [EMAIL PROTECTED] WEB: http://badcheese.com/~steve
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/