Hi All,

I have just simplified the thread priority management in the
DatabasePager and added stats support to the DatabasePager, as well as
use of this to the osgViewer::StatsHandler.  An svn update will get
these changes.

The four new methods added to DatabasePager are:

        /** Get the minimum time between the first request for a tile
to be loaded and the time of its merge into the main scene graph.*/
        double getMinimumTimeToMergeTile() const { return
_minimumTimeToMergeTile; }

        /** Get the maximum time between the first request for a tile
to be loaded and the time of its merge into the main scene graph.*/
        double getMaximumTimeToMergeTile() const { return
_maximumTimeToMergeTile; }

        /** Get the average time between the first request for a tile
to be loaded and the time of its merge into the main scene graph.*/
        double getAverageTimeToMergeTiles() const { return
_totalTimeToMergeTiles/static_cast<double>(_numTilesMerges); }

        /** Reset the Stats variables.*/
        void resetStats();

I have removed the following thread priority methods:

        void setUseFrameBlock(bool useFrameBlock) { _useFrameBlock =
        bool getUseFrameBlock() const
        osg::RefBlock* getFrameBlock()
        void setThreadPriorityDuringFrame(ThreadPriority)
        void setThreadPriorityOutwithFrame(ThreadPriority)

To control the thread priority you now simply use the standard
OpenThreads::Thread ::setSchedulePriority(..) method i.e.
  
viewer.getDatabasePager()->setScedulePriority(OpenThreads::THREAD_PRIORITY_NORMAL);

Previously the thread priority was THREAD_PRIORITY_MIN so I've left it
as this so users can look at the database pager stats before we make
any changes.  It has been suggested that Windows on single core
systems doesn't cope well with these as the default setting so
something like THREAD_PRIORITY_DEFAULT would be better.  I'd like to
get feedback on this - upping the priority will make things page in
quicker, but increase the chance of breaking frame.

I am tempted to add an env check to be able to set the priority.

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

Reply via email to