Subject: Re: [Boost-bugs] [Boost C++ Libraries] #3504: deadline_timer (based on UTC time) is not suitable for communication timeouts
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-11-25 21:16:40
#3504: deadline_timer (based on UTC time) is not suitable for communication
timeouts
--------------------------------------------+-------------------------------
Reporter: Bjarne Laursen <bla@â¦> | Owner: chris_kohlhoff
Type: Feature Requests | Status: closed
Milestone: Boost 1.41.0 | Component: asio
Version: Boost 1.41.0 | Severity: Problem
Resolution: wontfix | Keywords:
--------------------------------------------+-------------------------------
Comment (by kjohnson@â¦):
I may be wrong, but I think the attached file "monotone_timer.hpp-
NO_MUTEX" suffers from really bad roll over issues. Multiplying a rolling
monotonic timer by a constant (1000000000/frequency.QuadPart on line 80)
doesn't produce a valid monotonic nanosecond count.
I've attached the version I'm trying which keeps times and durations in
terms of the performance counter
(monotone_timer_better_rollover.cpp/.hpp).
You use it as:
TimerImpl m_Timer;
m_Timer.expires_from_now(TimerTraits::milliseconds_to_duration(milliseconds_delay));
I agree that this is a really big issue. I was hoping when we started
using boost that we would be spending out time writing our application,
not spending hours trying to get a basic timer working reliably.
I also think the documentation should be changed. The example provided
(e.g.
http://www.boost.org/doc/libs/1_45_0/doc/html/boost_asio/example/timers/tick_count_timer.cpp)
is *WRONG* and doesn't work as expected.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/3504#comment:10> 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:04 UTC