Hi robert,
there is an other problem i currently have with the database pager. In fact
we have to protect our readNodeFile
otherwise we run into threading issues. The method is not thread safe at
all, so we have to protect it as you
did in database pager, in common application it work as expected, we are
thread safe
Line 565: DatabasePager.cpp
bool serialize_readNodeFile = true;
if (serialize_readNodeFile)
{
// do *not* assume that we only have one DatabasePager,
or that reaNodeFile is thread safe...
static OpenThreads::Mutex
s_serialize_readNodeFile_mutex;
OpenThreads::ScopedLock<OpenThreads::Mutex>
lock(s_serialize_readNodeFile_mutex);
databaseRequest->_loadedModel =
osgDB::readNodeFile(databaseRequest->_fileName,
databaseRequest->_loadOptions.get());
}
else
{
// assume that we only have one DatabasePager, or that
readNodeFile is thread safe...
databaseRequest->_loadedModel =
osgDB::readNodeFile(databaseRequest->_fileName,
databaseRequest->_loadOptions.get());
}
can you move the s_serialize_readNodeFile_mutex into the API (database pager
header) i need to lock / unlock it in an other thread. so it would be quite
important
that i can access this mutex outside the databasepager.cpp . please make a
method to lock, unlock the s_serialize_readNodeFile_mutex then i can myself
protect the readNodeFile. The best would be to attach the readNodeFile lock
in the API readfile as static method, so everybody can make use of this
protection.
sugestion:
add in ReadFile:
static OpenThread::Mutex ;
and in the DatabasePager:
OpenThreads::ScopedLock<OpenThreads::Mutex>
lock(osgDB::s_serialize_readNodeFile_mutex);
/Adegli
--
********************************************
Adrian Egli
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org