On Nov 30, 2007 10:16 PM, André Garneau <[EMAIL PROTECTED]> wrote: > 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.
The ReentrantMutex naming convention is inherited from another project from a number of years back, can't remember the details now. > >> 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. Its absolute crucial that things behave the same on all platforms, the implementations may vary, but the behaviour needs to be the same as far as possible. If some one want to volunteer a Win32 version then I'm open. Performance wise there isn't any critical points in the OSG that use ReentrantMutex, so I don't see a strong need to trying to optimize it. I have found occasional problems with ReentrantMutext though, but haven't yet pinpointed the cases where it fails clearly enough to know the case/provide a fix. So the code itself could do with improving... Robert. _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

