Hi Tanguy,

It all depends upon the threading model your are using.  Lots has been
written on this topic so searching the archives will reveal lots of info.
The threading models that require extra care are DrawTheadPerContext and
CullThreadPerCameraDrawTheadPerContext, for these the draw thread can run in
a parallel with the main frame loop thead so does have potential threading
issues if you don't take care.  The way to manage things safely is to make
sure the StateSet and Drawables that are dynamically updated have their
DataVariance set to DYNAMIC.

I've written this hundreds of times before so go have a look through the
archive.

Robert.

On Thu, Apr 2, 2009 at 5:48 PM, Tanguy Fautre
<[email protected]>wrote:

> Hi Robert,
>
> Chasing a set of bugs, I'm very sceptical about the update logic of our
> application. In a nutshell, here is currently what we are doing:
>
>        while (! done)
>        {
>                const double time = elapsedTime();
>
>                updateScene(time);
>
>                osgViewer::Viewer::frame(time);
>        }
>
>
> The updateScene() function makes several changes to the scenegraph
> (including: changing object positions, adding new nodes, changing text,
> etc).
>
> This looks however very suspicious to me as far as thread-safety is
> concerned.
>
> Could you confirm or deny my fears?
>
>
> Cheers,
>
> Tanguy
>
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to