Boost C++ Libraries: Ticket #4749: Problem with deadline_timer on MacOSX https://svn.boost.org/trac10/ticket/4749 <p> When multiple threads call io_service::run() and there is one active deadline_timer, deadline_timer takes much more time to invoke the handler that specified.<br /> </p> <p> This has been observed on MacOSX 10.6, XCode 3.2.2 using the test application posted below. The time between the 1st and 2nd invoke of "print1" is almost 5 minutes instead of 1 second.<br /> </p> <p> It runs fine on Windows and Linux and when defining BOOST_ASIO_DISABLE_KQUEUE, the problem disappears on MacOSX. </p> <pre class="wiki">#include &lt;iostream&gt; #include &lt;boost/asio.hpp&gt; #include &lt;boost/thread.hpp&gt; #include &lt;boost/bind.hpp&gt; #include &lt;boost/date_time/posix_time/posix_time.hpp&gt; class printer { public: printer(boost::asio::io_service&amp; io) : strand_(io), timer1_(io, boost::posix_time::seconds(1)), count_(0) { timer1_.async_wait(strand_.wrap(boost::bind(&amp;printer::print1, this))); } ~printer() { std::cout &lt;&lt; "Final count is " &lt;&lt; count_ &lt;&lt; "\n"; } void print1() { if (count_ &lt; 10) { std::cout &lt;&lt; "Timer 1: " &lt;&lt; count_ &lt;&lt; "\n"; ++count_; timer1_.expires_at(timer1_.expires_at() + boost::posix_time::seconds(1)); timer1_.async_wait(strand_.wrap(boost::bind(&amp;printer::print1, this))); } } private: boost::asio::strand strand_; boost::asio::deadline_timer timer1_; int count_; }; int main() { boost::asio::io_service io; printer p(io); boost::thread t(boost::bind(&amp;boost::asio::io_service::run, &amp;io)); io.run(); t.join(); return 0; } </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4749 Trac 1.4.3 samjmill@… Mon, 18 Oct 2010 15:33:11 GMT cc set https://svn.boost.org/trac10/ticket/4749#comment:1 https://svn.boost.org/trac10/ticket/4749#comment:1 <ul> <li><strong>cc</strong> <span class="trac-author">samjmill@…</span> added </li> </ul> <p> I don't see this behavior using asio 1.45, which I believe is Boost 1.43. So this appears to be a regression in Boost 1.44. </p> Ticket chris_kohlhoff Mon, 18 Oct 2010 20:52:27 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/4749#comment:2 https://svn.boost.org/trac10/ticket/4749#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">duplicate</span> </li> </ul> <p> Duplicate of <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4568" title="#4568: Bugs: deadline_timer stop at boost-1.4.4 (closed: fixed)">#4568</a>. </p> Ticket