I just got around it by updating a thread-safe character array and set a flag when my text changed, then the updatecallback() just looked for that flag every frame and if it was set, it updated all of the text nodes and reset the flag. Seems to work fine. I've been running for 48 hours without a segfault using this method. :)

- Steve

On Thu, 4 Jan 2007, Robert Osfield wrote:

Date: Thu, 4 Jan 2007 18:55:53 +0000
From: Robert Osfield <[EMAIL PROTECTED]>
Reply-To: osg users <[email protected]>
To: osg users <[email protected]>
Subject: Re: [osg-users] Segfaulting somewhere in osgText

On 1/4/07, Antoine Hue <[EMAIL PROTECTED]> wrote:
I agree that adding this functionality to the osgtext::Text  would be
simpler and more efficient. Still having no time to make a concrete
proposal I got mute.

It would certainly not be more efficient, having to mutex access is
one sure way to add performance bottlenecks, there is also the issue
of data coherency - with one camera capturing one version of the text,
and the adjoining camera capturing the updated version.

The OSG is designed around single threaded update, multi-threaded
cull-draw, if you break this usage style then you are one your own -
you have to mutex (and even then its not perfect as above) or
multi-buffer again which is not ideal.  Just updating in the update
phase and you get no problems.

Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


--
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/

Reply via email to