On Sat, Dec 18, 2010 at 2:27 AM, David Fries <da...@fries.net> wrote:

> Computers are coming out with more and more cores which will only
> increase the number of threads in use.  Currently OpenSceneGraph has a
> bottleneck in scene graph operations limiting the performance of
> multithreaded programs, even when they are operating on completely
> separate nodes as the Drawable, Node, and StateAttribute addParent and
> removeParent all contend on one global mutex.
>
> OpenThreads::Mutex* getRefMutex() const { return
> getGlobalReferencedMutex(); }
>
Thanks for looking  into this. Some of us have recently been looking hard at
thread safety and performance issues in OSG.

The global referenced mutex is unfortunate, not least because its use is
buggy. I would facetiously call it a "Writer lock;" writers of the _parents
list lock it, but none of the readers do! So obviously this should be some
kind of ReaderWriter lock, but that has its own issues, not least of which
is that the OpenThreads ReaderWriterMutex implementation is suspected of
being buggy, if I recall correctly.

So, I don't know what to say about your Atomic Global Mutex work. My own
feeling  is that something like Linux' RCU list
(http://en.wikipedia.org/wiki/Read-copy-update), which would eliminate most
of not all of the synchronization on the parent list, is a better approach.
This is even more true if the global mutex were being used correctly :)

Tim
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to