[osg-users] Safely loading paged databases at runtime

Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC Shayne.Tueller at HILL.af.mil
Mon Mar 23 10:06:43 PDT 2009


That is what I was going to say as well. I've been bitten by the smart
pointer/ref_ptr issue more times than I care to admit...;^)

Glad you got it figured out...

-----Original Message-----
From: osg-users-bounces at lists.openscenegraph.org
[mailto:osg-users-bounces at lists.openscenegraph.org] On Behalf Of Jason
Sent: Monday, March 23, 2009 11:01 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Safely loading paged databases at runtime

Hi Robert,

Ha, I was just getting ready to reply to you saying I've found the issue:)

That was exactly it, switching over to using using a ref_ptr within the
ReaderWriterOSGEarth plugin for the cached TileBuilder objects seems to have
fixed my issue.



2009/3/23 Robert Osfield <robert.osfield at gmail.com>

	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.
	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?
		osg-users mailing list
		osg-users at lists.openscenegraph.org

	osg-users mailing list
	osg-users at lists.openscenegraph.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 6028 bytes
Desc: not available
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20090323/552bbcf3/attachment-0003.bin>

More information about the osg-users mailing list