[Boost-bugs] [Boost C++ Libraries] #4205: Excessive CPU using in run_one in ASIO

Subject: [Boost-bugs] [Boost C++ Libraries] #4205: Excessive CPU using in run_one in ASIO
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-05-11 17:17:20


#4205: Excessive CPU using in run_one in ASIO
-----------------------------------------+----------------------------------
 Reporter: Tim Smith <tim@…> | Owner: chris_kohlhoff
     Type: Bugs | Status: new
Milestone: Boost 1.43.0 | Component: asio
  Version: Boost 1.44.0 | Severity: Regression
 Keywords: |
-----------------------------------------+----------------------------------
 OS: Windows Server 2003

 In the windows code for run_one, we are seeing excessive CPU when using
 timers. We didn't see this issue with 1.40.

 The problem turns out to be that when we have timers, the computation for
 timeout (via get_timeout()), is too small. Thus the IOCP query returns
 and no timers are delivered. This leads to a flurry of CPU usage where
 the timeout is zero and no timers are still delivered. The CPU usage
 stops when the next pending timer is finally delivered.

 To resolve the issue (a total temporary hack to our code), we added a bias
 of 1ms to the call to get_timeout(). (i.e. timeout = get_timeout() + 1;).
 This caused the CPU usage to drop back down to normal levels.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/4205>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:03 UTC