Boost C++ Libraries: Ticket #7089: BOOST_THREAD_WAIT_BUG limits functionality without solving anything https://svn.boost.org/trac10/ticket/7089 <p> In upgrading from 1.45 to 1.50 I noticed the following, which I think first appeared in 1.47: </p> <p> <a class="ext-link" href="https://svn.boost.org/trac/boost/ticket/6130"><span class="icon">​</span>Ticket 6130</a> reported a bug that on linux a call to the following would return early: </p> <pre class="wiki">condition_variable::timed_wait(lock, time) </pre><p> Consequently, a code change was made to introduce BOOST_THREAD_WAIT_BUG which forces at least a 1 millisecond sleep. </p> <p> I think <a class="ext-link" href="https://svn.boost.org/trac/boost/ticket/6130"><span class="icon">​</span>Ticket 6130</a> should have been rejected since the reported behavior is an artifact of 'spurious wake-ups' on linux and is solved by using the following: </p> <pre class="wiki">condition_variable::timed_wait(lock, time, predicate) </pre><p> This technique is referenced in the boost documentation. </p> <p> I would like to see BOOST_THREAD_WAIT_BUG removed in order to eliminate the minimum 1 millisecond wait time it introduced. BOOST_THREAD_WAIT_BUG only masks the issue of spurious wake-ups as it can still happen if a predicate is not used. </p> <p> Potentially off-topic: It would be nice if condition_variable encapsulated the predicate functionality on linux unless there's a valid reason that eludes me. Encapsulation would have several benefits such as not confusing the uninitiated, and avoiding the need for wrapper classes. </p> <p> --Jason Aubrey </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7089 Trac 1.4.3 jason@… Thu, 05 Jul 2012 17:30:54 GMT <link>https://svn.boost.org/trac10/ticket/7089#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7089#comment:1</guid> <description> <p> I meant to say that BOOST_THREAD_WAIT_BUG introduced a minimum wait time of 100 milliseconds on linux. --Jason Aubrey </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Fri, 06 Jul 2012 18:07:17 GMT</pubDate> <title>owner, status changed https://svn.boost.org/trac10/ticket/7089#comment:2 https://svn.boost.org/trac10/ticket/7089#comment:2 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Anthony Williams</span> to <span class="trac-author">viboes</span> </li> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> <p> You are right <a class="changeset" href="https://svn.boost.org/trac10/changeset/78285" title="Thread: try to fix ticket 6130 for linux systems">[78285]</a> should not be merged to the release branch as not confirmed as a solution. I will roll back the change. </p> Ticket viboes Sat, 07 Jul 2012 15:09:50 GMT milestone changed https://svn.boost.org/trac10/ticket/7089#comment:3 https://svn.boost.org/trac10/ticket/7089#comment:3 <ul> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.51.0</span> </li> </ul> <p> Committed in trunk 79327 </p> Ticket viboes Mon, 09 Jul 2012 21:14:37 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/7089#comment:4 https://svn.boost.org/trac10/ticket/7089#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Committed revision <a class="changeset" href="https://svn.boost.org/trac10/changeset/79373" title="Thread: merge from trunk">[79373]</a>. </p> Ticket acidtonic Thu, 23 Aug 2012 21:32:50 GMT <link>https://svn.boost.org/trac10/ticket/7089#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7089#comment:5</guid> <description> <p> I had a similar bug on Windows with condition_variable::wait(lock) never returning after upgrading from 1.45 to 1.50. </p> <p> I had to switch to a timed_wait(lock, time) and wait for a single timeout before being woke up. </p> <p> In 1.45 the exact same project (confirmed via SVN history) does not exhibit this behavior and wait(lock) is enough. </p> <p> MinGW on Windows XP, GCC 4.6.1. </p> <p> Is this related by chance? Should I try 1.51 now? </p> </description> <category>Ticket</category> </item> </channel> </rss>