Hi Torben, Nick's answer most of your questions so I won't dive into the details. What I would like to add is that last week I refactor OpenThreads::ReentrantMutex and Mutex so that the later now provides an option in its constructor for deciding whether to set up a reentrant/recusrive mutex or a standard one, with ReentrantMutex now just subclassing from Mutex and setting the default to the reentrant/recursive mutex.
Implementation wise Mutex now utilities the underlying threading support for these two types of mutex, rather than attempting to implement itself with it's own counters. The old manual scheme was had some subtle bugs in it that weren't straight forward to fix so rather than attempt this I just opted to utilising the native support for reentrant/recursive mutexes - in the case of windows all mutexes are reentrant so it's effectively a noop, but for pthreads based systems the mutex type is set to be recursive. Now I'd recommend using svn/trunk or 2.9.7 to get the latest incarnation of ReentrantMutex, otherwise there is a chance that you might uncover one of the conditions that could break the old ReentrantMutex. Robert. On Tue, Feb 23, 2010 at 1:51 PM, Torben Dannhauer < z...@saguaro-fight-club.de> wrote: > Hi, > > I have to secure a std::vector for multithreaded access and used a > Reentrant Mutex for this. > > (btw: Whats the diferent between reentrant mutex and mutex?) > > On my development Platform (Vista) this works great. > On windows XP 32 bit, the application hangs on this mutex, although it is > not locked. > > > What is the best way to secure access to a std::vector which should run on > all platforms? > > I' have seen this scopedLock is often used, by I have no clue what this is > about and how it works. > > Has anybody an idea where to get further information? > > Thank you! > > Cheers, > Torbenand Wind > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=24697#24697 > > > > > > _______________________________________________ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org >
_______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org