Hi Ryan,

On Tue, Jun 16, 2009 at 5:30 PM, Kawicki, Ryan
H<[email protected]> wrote:
> Robert,
>
> I want to take us back to a bug that was found in Sep. of 2008.
>
> http://www.mail-archive.com/[email protected]/msg15483.
> html

The issue brought up in the original thread has been already been
addressed in recent OSG versions, so the getRefMutex no longer returns
NULL, but returns the shared global mutex.   So I don't believe this
is an issue any more.

>
> I do agree that there was an issue at this point not having some kind of
> locking system in place when accessing the parents, but is a global
> mutex the right answer when _OSG_REFERENCED_USE_ATOMIC_OPERATIONS is
> defined.  If two unrelated group nodes on different threads add
> unrelated children, there is the possibility that one will block the
> other.  A perfect example of this is the main thread and a database
> pager.


I'm not clear on how this example would cause a problem with a single
mutex lock being used in this context.  Do you have an actual
crash/error in behavior that you have observed?


> As stated by the previous thread, this is not only related to group
> nodes.  Drawables, Nodes, StateAttributes, and StateSets also use the
> global mutex.  Was there a reason for using a global mutex instead of a
> mutex owned by an instance of osg::Referenced?

Speed of creation and deletion objects and memory consumption is the
reason not to have a Mutex per Referenced object.  Mutex's are
relatively large and slow to create/destroy which is amoung the
reasons why using atomic ref counts where possible is desirable.

Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to