Hi Jimmy,

The OSG doesn't support general multi-threaded update, you have to
serialize all the updates and make sure they happen during the update
phase of the frame.

Support for general mult-threaded update would complicate the scene
graph design, implementation, usage and have a big hit on performance,
so it's something I've strongly avoided.

It isn't difficult to manage applications so that they do single
threaded update, which route is best for you will depend upon your
needs.  You don't provide any information about what you are trying to
do and why so it's rather too open ended to go suggest what you should
do.

Robert.

On Tue, Jun 1, 2010 at 5:47 AM, Jimmy Lin <[email protected]> wrote:
> Hi,
>
> On relative issue.
>
> What if viewer->frame() is running on different thread that is different to 
> the thread that modifies the scene graph. In that case I don't really have 
> the control when is frame() get called. the modification can happen during 
> the rendering time, which I guess is bad.
>
> I tried use lock/unlock wrap around frame() and where ever I modify the 
> scene, but this introduce serious performance issue.
>
> The only solution I can think of is use UpdateCallback. but wouldn't the same 
> problem happens when modify the update callback at the same time as frame() 
> doing the updatetraversal? or does OSG have a way to protect the data during 
> the updatetraversal ??
>
> Or is there other approach you can advice me.
>
>
> Thank you!
>
> Cheers,
> Jimmy
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=28388#28388
>
>
>
>
>
> _______________________________________________
> 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