Hi Pjotr, On 7 November 2014 09:07, Pjotr Svetachov <pjotrsvetac...@gmail.com> wrote:
> Because you also have to deal with subobject like proxy nodes and images > that you want to have in the cache option 2 and 3 will be pretty hard to > implement. > > Option one seems like the elegant solution as right now you can only > activate those post processing steps if you have a database pager (or you > implement them yourself). Also looking at the code there are already some > post process things in the Registery and Database Pager that overlap. For > instance there is a _buildKdTreeIfRequired method in Registery but > FindCompileableGLObjectsVisitor also tries to build a kdtree. > I've been thinking further and believe the we'll need to move the post processing and object cache insertion out of Registry, at least for the DatabasePager usage. One issue that requires this is that you don't want to have to process and compile the same subgraph multiple times, so if the data comes from the cache then not doing the post processing and compile makes sense, but if a subgraph pulled in from the object cache has only recently been loaded and is currently being post processed/compiled by another DatabaseThread then you'd want this second traversal to wait till all this work has been done. The later issue can be resolved by only placing a subgraph in the object cache once it's ready to merge with the main scene graph. This would mean any cross overs of requesting the same external filename would lead to multiple loads, which isn't ideal but at least it would thread safe. The second approach might be to store a mutex block with the objects in the object cache and when only release this block once the subgraph has been fully processed and compiled. > > Btw: whatever you choose it would be a good idea to split the post > processing traversal from the compile set collecting anyway for better > readability. This would lead to multiple traversals and higher performance cost. You are better to do all the operations on the same data at the same time to make the most of cache coherency. -- One problem I have with coming up with a solution with these object cache/DatabasePager issue is that I don't have any test case that illustrates the problems. Any chance you could put together a small example that illustrates your usage model? Robert.
_______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org