No, let's talk about the details here.  OpenSG, like other scene graphs of the past, uses a multi-bufferred approach to effect thread safety.  OpenSceneGraph has avoided this route for the multiple disadvantages of a multi-buffered system.

A multi-buffered system requires that there be a buffer for each phase (Update/Cull/Draw) multiplied by the number of threads.  That means that there is a non-linear relationship between number of threads and numbers of buffers that need to be allocated.  By buffers I mean entire copies of the scene graph.

This has at least three distinct disadvantages: 1) Synchronization of buffers is complex - Complexity adds more possible pitfals and overhead.  2) Memory footprint 3) multi-threaded complexity for single theaded applications - What I mean here is that single threaded applications get all the complexity of multithreaded applications whether they want it or not.

OSG uses a read-only protection of data on a single copy of the scene graph for each of the downstream phases.  The advantages of this approach, at least meets the problems of a multi-buffered approach mentioned above.  The one rule that this imposes, is that you cannot modify the scene graph during the cull/draw phase.

But this is an easy rule to live with.  If one really, really needs to modify the scene graph during this time, it is a simple exercise to effect double buffering of the scene graph, allowing a separate thread to work on the buffer that is not being used by cull/draw pairs.  Double buffering is a far cry from Multi-buffering and it retains nearly the linear scalability of a non-buffered approach.

One other disadvantage of a mult-buffered system is increased latency.

I write this to counter the perception that adding full thread safety to a scene graph is somehow a superior approach.  One need only take a few minutes to try and design a fully thread safe scene graph to realize the amount of complexity and overhead this introduces.  Full thread safety comes with an expensive cost.  OSG was designed purposely the way that it has been because of the clear advantages of a single copy scene graph.

And, Dirk, I'd be quite happy to post this explanation to opensg-users if you'd like. 

-don
On 9/14/06, Dirk Reiners < [EMAIL PROTECTED]> wrote:
ObPlug: OpenSG is threadsafe. Mail me for details.

(Sorry, couldn't resist ;)

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

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

Reply via email to