Modify

Opened 7 years ago

Closed 7 years ago

Last modified 7 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.

Attachments (0)

Change History (3)

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

Version: Boost 1.44.0Boost 1.43.0

comment:2 Changed 7 years ago by chris_kohlhoff

Resolution: fixed
Status: newclosed

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

comment:3 Changed 7 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.

........

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain chris_kohlhoff.
The resolution will be deleted.

Add Comment


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

 
Note: See TracTickets for help on using tickets.