Hi Pjotr et. al, On 27 October 2014 13:44, Pjotr Svetachov <pjotrsvetac...@gmail.com> wrote:
> I'm with you on not changing an image (or other objects) state when it's > already in a cache. If people don't want this they should turn the cache > off or clear the cache or clone things in the cache or whatever they need. > OSG has options for that. > My current inclination is we could possible use the DataVariance of the Image/Texture/Geometry as a marker to tell the FindCompileableGLObjectsVisitor whether it can modify the objects or not. If it does modify the objects then it'd set the DataVariance. I haven't tried this modification yet as I've been chasing up other problems with the DatabasePager/osgTerrain combination. -- Most of this week I've been banging my head up against validgrind/helgrind/drd looking at various false positives, trying to sift out the real threading problems from this forest of false positives. Turns out the valgrid makes assumptions about pthread usage that if you don't follow it assumes that threads haven't finished even though they have been long finished. To address this issue I re-introduced usage of Thread::join() rather than old code that implemented something similar using a while loop and YieldCurrentThread. I a vague recollection of join() being problematic on one platform over a decade ago, but can't recall the details. I think it's probably time to just embrace the join(). I have made a few other tweaks to fix warnings that were genuine threading conflicts but where benign in nature - reading/writing ints/bools. I will won't check these changes in right away as there is lots of debugging code in my version of the OSG right now. Once I've settled the major threading issues I'll return and implement these changes in a cleaner way. These changes should make it easier to spot serious problems using valigrind and other thread debugging tools as they won't have the false positives and benign threading issues. -- One of the items I'm been looking into is how the TerrainTile::init() method was being called by multiple threads when the basic design of the DatabasePager is meant to run a traversal single threaded before the subgraph is added to the main scene graph. It took me a while to track down the cause of the problem - and this morning I eventually spotted the problem... It turns out a mechanism I added to osgTerrain::Terrain/TerrainTile for implementing an update of tiles during the update traversal by having a local set of tiles to update. This local set of tiles to update is populated when one calls TerrainTile::setTerrain(), this setTerrain() now happens during the load, so during the load the new TerrrainTile registers itself even before the subgraph gets returned from the loaded to the DatabasePager. In hindsight this design breaks the general princple of new subraphs being able to work entirely separately from the main scene graph until they are merged. I haven't yet worked out to refactor this mechanism to avoid this issue - that's my focus of today. Robert.
_______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org