Hi Robert, Yeah, it's not ideal. I'm not aware of any lock-free map structures within the OSG library. Are there portions of the library that are currently using them?
One small improvement could be to use a ReadWriteMutex so once all the plugins are loaded, multiple threads can still access the wrappers concurrently. Would you like me to look into this for the short term? Cheers, Farshid On Mon, Jun 1, 2015 at 5:10 AM, Robert Osfield <[email protected]> wrote: > Hi Farshid, > > Thanks for the fix. I'm a bit uneasy about the lock around the > findWrappers as this will occur a penalty for all applications when > they load OSG native files, even when the loading of plugin phase is > complete. > > There are approaches such a thread safe non locking lists we could > look at to avoid the need for the mutex, but for now I think the > approach you have taken is probably the least intrusive approach to > resolving the thread safety side. I have merged your changes and > checked them into svn/trunk. > > Robert. > > On 28 May 2015 at 20:38, Farshid Lashkari <[email protected]> wrote: > > Hi Robert, > > > > I was getting "Unsupported wrapper class..." error messages when > attempting > > to load osgb models simultaneously from multiple threads. I believe the > > problem is caused by un-synchronized access to the global > > osgDB::ObjectWrapperManager class. I've attached a change that adds a > mutex > > to the class and uses it when accessing the internal wrapper/compress > maps. > > This appears to fix the issues I was having. > > > > Cheers, > > Farshid > > > > _______________________________________________ > > osg-submissions mailing list > > [email protected] > > > http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org > > > _______________________________________________ > osg-submissions mailing list > [email protected] > > http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org >
_______________________________________________ osg-submissions mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
