Hi Paul,

>> 1. I always understood "reentrant" to refer to code or an object that
could
>> be executed safely by multiple threads or processes. However, the
>> ReentrantMutex would only be used for code that is safe for the _same_
>> thread or process to execute concurrently, thus my confusion. Is the name
>> "reentrant" appropriate here?

I agree with you that "re-entrant" is a misnomer for this class. Some
frameworks use the term "recursive mutex" (i.e. ACE, Boost) for such
functionality, although this is still a debatable term for it.

>> 2. A couple years back I "simplified" the Mutex class for Windows. As a
>> result, it actually works somewhat like the ReentrantMutex. Mea culpa.

IMHO, I think it's actually an excellent thing to have it this way. The cost
of implementing counted lock acquisition is negligible and the savings in
debugging and maintenance time more than outweigh this cost. However this
does bring the issue of having possibly different behaviour when porting an
application from Windows to other platforms.

André


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

Reply via email to