[osg-users] Safely loading paged databases at runtime

Robert Osfield robert.osfield at gmail.com
Mon Mar 23 09:58:05 PDT 2009


Hi Jason,

Normally the DatabasePager works on loaded scene graph that are entirely
independent from the main scene graph and these subgraphs are only merged
with the main scene graph when the main frame loop calls the update on the
DatabasePager to merge any new tiles, remove expired ones.  The update is
down thread safe, with locking happening for all the appropriate places.  If
the place that the node is being attached is already unref'd from the scene
graph then the subgraph should just be safely discarded.

In the case of osgEarth do you have a pointers to global/parental structures
in the plugins that would break the normal scene graph encapsulation that
the database normally has?  If there is such a reference then it might be
best to take a reference to this global/parent strucutre during the running
of the plugin to prevent it going out of scope before the end of the call to
the plugin.

Robert.

2009/3/23 Jason Beverage <jasonbeverage at gmail.com>

> Hi Robert,
>
> I've been working with loading and unloading different osgEarth files at
> runtime (such as from a File | Open menu) using OSG and have found that I
> need to take special care to make sure that the DatabasePager is not working
> on a loaded node before removing it and replacing it with a different
> scene.  This isn't a big deal and essentially consists of telling the
> database pager to not accept any new requests, clearing any pending requests
> and waiting for the pager to complete by checking the getRequestsInProgress.
>
> I've found that if I simply replace the main earth file's node with a new
> one while the DatabasePager is working, my application will crash.  Is this
> the intended behavior or have I found a potential issue?
>
> Thanks!
>
> Jason
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20090323/494daadc/attachment-0003.htm>


More information about the osg-users mailing list