[osg-users] New Improved DatabasePager, now with even more threading! Please take a taste today :-)

Csaba Halász csaba.halasz at gmail.com
Tue Jun 3 07:14:56 PDT 2008


On Tue, May 27, 2008 at 12:08 PM, Tim Moore <timoore at redhat.com> wrote:
>
> Indeed. I've made the necessary changes to FlightGear, and it seems to
> be working fine.

Except for being a cpu hog.

Apparently, the pager thread is not blocked properly and continuously
spins. The fact that the queue is empty is confirmed by the debug
messages printed after the block call:
HANDLE_NON_HTTP 0: _pager->_requestList.size()= 0 to delete = 0

I have been trying to find the place where the blocking is
re-established when the queue goes empty, but could not find it. So I
added an updateBlock() call at the end of
DatabasePager::RequestQueue::takeFirst that seems to fix the issue.
Could have added the call within the if-block, but this has the
additional benefit of stopping runaway loops should somehow the pager
thread get woken up without work to do.

Index: DatabasePager.cpp
===================================================================
--- DatabasePager.cpp   (revision 8398)
+++ DatabasePager.cpp   (working copy)
@@ -273,6 +273,7 @@
         databaseRequest = _requestList.front();
         _requestList.erase(_requestList.begin());
     }
+    updateBlock();
 }


I am not sure if I need an osg-submissions mail for this?

-- 
Cheers,
Csaba/Jester


More information about the osg-users mailing list