Hi, Is it possible in OSG to make changes to the scene graph from a thread other than the rendering thread? What kind of thread-safety does OSG provide on its own and which OSG functions that run in the rendering thread will have to be protected with additional mutexes?
I already tried protecting both the rendering code and code changing the scene graph with a common mutex. However, this approach seems to have problems. The rendering thread seems to be holding the mutex almost 100% of the time, particularly while it is waiting for V-sync. This seems to be happening somewhere in renderingTraversals. Is it possible to split renderingTraversals up into separate calls without making changes to or subclassing the OSG viewer classes? In general, would you recommend such an approach at all, or is it a bad idea to change the scene graph outside the rendering thread? In my application, this approach would be a convenient solution for changing the scene graph in response to external events other than user input. These events are usually handled in separate threads, and if scene graph updates were limited to the rendering thread, this would require communication between threads which is both complicated and expensive. Thank you! Cheers, sqrtK ------------------ Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=15064#15064 _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org