Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#4205 closed Bugs (fixed)

Excessive CPU using in run_one in ASIO

Reported by: Tim Smith <tim@…> Owned by: chris_kohlhoff
Milestone: Boost 1.43.0 Component: asio
Version: Boost 1.43.0 Severity: Regression
Keywords: Cc:

Description

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.

Change History (3)

comment:1 by Tim Smith <tim@…>, 12 years ago

Version: Boost 1.44.0Boost 1.43.0

comment:2 by chris_kohlhoff, 12 years ago

Resolution: fixed
Status: newclosed

(In [62497]) Fix handling of small but non-zero timeouts. Fixes #4205.

comment:3 by chris_kohlhoff, 12 years ago

(In [62644]) Merge from trunk.

........

r62497 | chris_kohlhoff | 2010-06-07 09:28:58 +1000 (Mon, 07 Jun 2010) | 2 lines

Fix handling of small but non-zero timeouts. Fixes #4205.

........

r62499 | chris_kohlhoff | 2010-06-07 10:00:45 +1000 (Mon, 07 Jun 2010) | 2 lines

Reworked implementation MkII. Also fixes #4170.

........

r62530 | chris_kohlhoff | 2010-06-08 09:24:28 +1000 (Tue, 08 Jun 2010) | 2 lines

Fixes for MSVC 7.1, Borland.

........

r62531 | chris_kohlhoff | 2010-06-08 09:29:05 +1000 (Tue, 08 Jun 2010) | 2 lines

Some changes for Symbian support.

........

r62549 | chris_kohlhoff | 2010-06-08 14:27:26 +1000 (Tue, 08 Jun 2010) | 2 lines

Fix typo in tutorial. Fixes #4252.

........

r62556 | chris_kohlhoff | 2010-06-08 19:01:39 +1000 (Tue, 08 Jun 2010) | 2 lines

Ensure unsigned char is used with isdigit. Fixes #4201.

........

r62558 | chris_kohlhoff | 2010-06-08 21:01:57 +1000 (Tue, 08 Jun 2010) | 2 lines

Fix handling of empty buffer sequences.

........

Note: See TracTickets for help on using tickets.