Boost C++ Libraries: Ticket #6835: Timer and Sleep issues with system clock https://svn.boost.org/trac10/ticket/6835 <p> Hi, </p> <p> I think there is an isue currently with some of the classes that use time sensitive code. </p> <p> After a quick look, I found that boost::deadline_timer and this_thread::sleep() were sensitive to system clock change. </p> <p> Even if using durations (instead of relative times) setting the system clock back affects those timers. </p> <p> Do you know what might be the cause of such behavior (eventhough duration is used)? </p> <p> Thanks </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6835 Trac 1.4.3 Luc Moreault <lmoreault@…> Fri, 04 May 2012 14:58:55 GMT <link>https://svn.boost.org/trac10/ticket/6835#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6835#comment:1</guid> <description> <p> Hi, </p> <p> Anybody witnessed the same issue or tried to replicate it? </p> <p> This can cause serious issues in some situations where the clock is set when the code is running. </p> <p> Thanks </p> </description> <category>Ticket</category> </item> <item> <dc:creator>chris_kohlhoff</dc:creator> <pubDate>Mon, 28 May 2012 23:59:07 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/6835#comment:2 https://svn.boost.org/trac10/ticket/6835#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">invalid</span> </li> </ul> <p> The asio::deadline_timer typedef uses the UTC clock, as documented <a href="http://www.boost.org/doc/libs/1_49_0/doc/html/boost_asio/reference/deadline_timer.html">here</a>. </p> <p> If you don't want to be sensitive to UTC clock changes then use the new asio::steady_timer typedef, or write your own custom time traits to use an alternative clock as shown in <a href="http://www.boost.org/doc/libs/1_49_0/doc/html/boost_asio/examples.html#boost_asio.examples.timers">this example</a>. </p> Ticket Luc Moreault <lmoreault@…> Tue, 29 May 2012 11:50:46 GMT <link>https://svn.boost.org/trac10/ticket/6835#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6835#comment:3</guid> <description> <p> Hi chris, </p> <p> Thanks for the steady_timer pointer. Do you have a similar suggestion for other timing related calls? (this_thread::sleep) </p> <p> Regards, Luc </p> </description> <category>Ticket</category> </item> <item> <dc:creator>chris_kohlhoff</dc:creator> <pubDate>Tue, 29 May 2012 20:46:22 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6835#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6835#comment:4</guid> <description> <p> You could use steady_timer's synchronous wait() function. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Wed, 20 Jun 2012 19:56:13 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6835#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6835#comment:5</guid> <description> <p> Was that also changed in condition_variable (timed_wait)? </p> <p> Thanks, Luc </p> </description> <category>Ticket</category> </item> <item> <dc:creator>chris_kohlhoff</dc:creator> <pubDate>Wed, 27 Jun 2012 11:48:49 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6835#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6835#comment:6</guid> <description> <p> Not my area, sorry. </p> </description> <category>Ticket</category> </item> </channel> </rss>