HI Serge, I'm afraid it take me almost a much time to figure out how to do it them tell you how to do it as it would be for me to go ahead an implement...
There are two things that hold paging up - the loading itself, in particular the latency in accessing the file, and secondly the incrementally loading of OpenGL objects required to ensure constant framerates are achieved. The later is often the large of the two, and if improve the loading - the bottleneck will still be the incremental loading so you might not see much of an improvement. These leads to the question of how to improve the performance of loading OpenGL objects, and the possible answer to this is to create a set of database pager graphics contexts + threads that share their context with the main rendering graphics contexts. The database pager graphics threads could run all the time, rather than just at small couple of millisecond chunks per frame. This is in theory could significantly reduce the OpenGL object loading and deletion overhead. It might be that you'd want to couple the file load pool of threads with the graphics threads - so that after each load the thread does a makeCurrent for each context and downloads all the texture objects, then moves on to the next context that needs downloading. This combined approach might be the best performance wise, as even with multi-core CPU's we have today we are still short of processors to do the work, and having all these threads starting/stopping and passing mutexed data between them could well cost more than you gain by having an abundance of threads. My plan was to look at this work during the next few months, but not right now, got plenty of other work to complete first. Robert. On 1/11/07, Serge Lages <[EMAIL PROTECTED]> wrote:
Any recommandations or suggestions on how to implement it ? I tried doing something by using multiple threads into my plug-in, but it means using a lot of tricks to get it works correctly, so I should take a look directly into Database pager, it should be a lot more clean. :) On 1/11/07, Robert Osfield <[EMAIL PROTECTED]> wrote: > Hi Serge, > > I have been contemplating having a thread pool in osgDB::DatabasePager > for a while. I have already done the work to enable the plugins to be > used multi-threaded - so the key operations in osgDB::Registry should > be thread safe and the main plugins like .ive and .osg are also thread > safe. Plugins that arn't thread safe need to have reentrant mutex to > protect them - the OpenFlight plugin being just one example. > > Robert. > > On 1/11/07, Serge Lages <[EMAIL PROTECTED]> wrote: > > Hi all, > > > > I was just wondering if anyone is interest by this feature: allowing the > > database pager to manage a thread pool to load multiple objects at the same > > time. > > Is it planed for one day (short or long term) ? > > And Robert, do you have any idea on the complexity to implement it ? Should > > it ask a huge refactoring ? > > The first probem that I saw is the plug-ins not being thread safe... :/ > > > > -- > > Serge Lages > > http://www.magrathea-engine.org > > _______________________________________________ > > osg-users mailing list > > osg-users@openscenegraph.net > > http://openscenegraph.net/mailman/listinfo/osg-users > > http://www.openscenegraph.org/ > > > > > _______________________________________________ > osg-users mailing list > osg-users@openscenegraph.net > http://openscenegraph.net/mailman/listinfo/osg-users > http://www.openscenegraph.org/ > -- Serge Lages http://www.magrathea-engine.org _______________________________________________ osg-users mailing list osg-users@openscenegraph.net http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
_______________________________________________ osg-users mailing list osg-users@openscenegraph.net http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/