Hi Serge,

On Fri, Mar 21, 2008 at 12:35 PM, Serge Lages <[EMAIL PROTECTED]> wrote:
> About cache, in our plugin its implemented thanks to SQLite support, it
> would be great to have a general approach into osgDB to have custom cache
> implementation. Thanks to that we could provide a simple file system based
> cache, but anyone would be able to make its own implementation.

Intersesting, I hadn't thought about implementing the cache in
anything other than a straight forward usage of local file system.
Perhaps a base class and straight forward file system implementation
could be placed in osgDB, attach the implementation to the Registry
and then allow users to override this with their own custom cache
implementation.


> > W.r.t going a mulit-threaded route where a request is made and then
> > the data is loaded later.  How do you go about implementing this?
> > Using ProxyNode?  Using your own database pager?
>
> We use the standard DatabasePager. In the plugin side, when a request comes,
> we ask to another thread if the file has already been requested. If not, we
> add it to a list and return a FILE_NOT_HANDLED response. If it has been
> requested before, we check the request status, if the file is available we
> return the correct node, if not we return again a FILE_NOT_HANDLED response.
>
> It works with ProxyNode or PagedLOD as they continue to ask for the node as
> long as they don't have any answer. And we can off course explicitely ask
> for a blocked response from the plugin if the request doesn't come from the
> DatabasePager.

Ahhh... I do remember something about this from discussion on
osg-users a way back.

> > My thought has been to change osgDB::DatabasePager so that is has one
> > or more database threads, so push the multi-threading here, rather
> > than into any specific plugin.
>
> Off course it's a better approach, when starting our plugin we thought about
> that, but it was much more simple to make the trick into our plugin instead
> of changing all the DatabasePager behaviour. Moreover it was still during
> the pre 2.0 period, and the DatabasePager (or the multi-threaded approach)
> wasn't as flexible as now.

Understood.  Altering DatabasePager threading model isn't trival.
Even I'm reluctant to dive and refactor it ;-)

Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to