Modify

Ticket #4205 (closed Bugs: fixed)

Opened 4 years ago

Last modified 4 years ago

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.

Attachments

Change History

comment:1 Changed 4 years ago by Tim Smith <tim@…>

  • Version changed from Boost 1.44.0 to Boost 1.43.0

comment:2 Changed 4 years ago by chris_kohlhoff

  • Status changed from new to closed
  • Resolution set to fixed

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

comment:3 Changed 4 years ago by chris_kohlhoff

(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.

........

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.