Hi Cedric,

I wouldn't have though my change will have introduced a new threading
issue, perhaps just revealed on old one though.  I've just done a
review of the Registry methods that access the cache and I can't find
any points where the Registr::_objectCacheMutex isn't locked before
access of the Registr::_objectCache map.

This leaves me without a lead w.r.t looking at how the viewer might be
reading from the cache at the same time as it's being cleared.   Could
you explain at what point this problem is occurring?

Robert.

On Mon, Sep 7, 2009 at 6:18 PM, Cedric Pinson<[email protected]> wrote:
> Hi Robert,
>
> I had a crash in my application because i use osgDB::readFilexxxx from
> another thread than Viewer.
> In fact there is a short window if the cache is cleared while another
> thread reference the data.
> osgDB::Registry::instance()->updateTimeStampOfObjectsInCacheWithExternalReferences(*getFrameStamp());
> osgDB::Registry::instance()->removeExpiredObjectsInCache(*getFrameStamp());
>
> Here the revision and the diff code on the link.
> [svn r10520] Moved the updating and expiry of the Registry object cache
> from DatabasePager into osgViewer::Viewer/CompositeViewer
> http://hg.plopbyte.net/osg-trunk/diff/85a3231b7b00/src/osgViewer/Viewer.cpp
>
>
> It's possible i had the problem before this commit, but i would just
> want to put it on the mailing list if other people have similar problem.
>
> For explanation this how i use it:
> for each player (10)
> I fetch the url http://a.com/node.osg -> the first time it will be
> downloaded then for other i will use the value in the cache registry
> (throw the readNodeFile).
> I clone the data in cache because i have to setup specific stuff by
> player so i can't modify the original data fetched in cache, i want to
> keep the data in cache clean.
>
>
> The reference count is 1 except when i get the pointer and clone it, so
> the
> osgDB::Registry::instance()->updateTimeStampOfObjectsInCacheWithExternalReferences(*getFrameStamp());
> does not update the timestamp and finally will delete the value in
> cache.
>
> I changed the expiry time to a very big value, but i would prefer to
> have a consistent fix. I guess i should keep the pointer on a kind of
> registry in my application.
>
>
> Cheers,
> Cedric
>
> -
> +33 659 598 614  Cedric Pinson mailto:[email protected]
> http://www.plopbyte.net
>
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to