Boost C++ Libraries: Ticket #7682: boost 1.52 named_mutex/named_condition pairing broken https://svn.boost.org/trac10/ticket/7682 <p> The following program works in boost 1.47, however in 1.52 it does not. To test it, run 2 instances. The 2nd instance should output the numbers 1, 3, 5, 7, 9. </p> <p> Under 1.52, the program outputs the number 1, and then does nothing. The fault appears to be with the named_condition and named_mutex classes. </p> <p> Tested under Windows 7 Pro, SP1, using Visual Studio 2010 v10.0.40219.1 SP1Rel. The test was done with a statically linked boost date time, with Platform Toolset set to v90, i.e. linked with the library 'libboost_date_time-vc90-mt-sgd-1_47.lib'. </p> <pre class="wiki">#include &lt;boost/interprocess/managed_shared_memory.hpp&gt; #include &lt;boost/interprocess/sync/named_mutex.hpp&gt; #include &lt;boost/interprocess/sync/named_condition.hpp&gt; #include &lt;boost/interprocess/sync/scoped_lock.hpp&gt; #include &lt;iostream&gt; int main() { boost::interprocess::managed_shared_memory managed_shm(boost::interprocess::open_or_create, "shm", 1024); int *i = managed_shm.find_or_construct&lt;int&gt;("Integer")(0); boost::interprocess::named_mutex named_mtx(boost::interprocess::open_or_create, "mtx"); boost::interprocess::named_condition named_cnd(boost::interprocess::open_or_create, "cnd"); boost::interprocess::scoped_lock&lt;boost::interprocess::named_mutex&gt; lock(named_mtx); while (*i &lt; 10) { if (*i % 2 == 0) { ++(*i); named_cnd.notify_all(); named_cnd.wait(lock); } else { std::cout &lt;&lt; *i &lt;&lt; std::endl; ++(*i); named_cnd.notify_all(); named_cnd.wait(lock); } } named_cnd.notify_all(); boost::interprocess::shared_memory_object::remove("shm"); boost::interprocess::named_mutex::remove("mtx"); boost::interprocess::named_condition::remove("cnd"); } </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7682 Trac 1.4.3 jeff.trull@… Thu, 24 Jan 2013 02:45:36 GMT <link>https://svn.boost.org/trac10/ticket/7682#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7682#comment:1</guid> <description> <p> I can confirm this behavior on 1.52 and also in trunk, for gcc 4.7.2. </p> </description> <category>Ticket</category> </item> <item> <author>jeff.trull@…</author> <pubDate>Thu, 24 Jan 2013 18:23:20 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7682#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7682#comment:2</guid> <description> <p> Breaking rev is 80146 "[named_/interprocess]sharable_mutex &amp; [named_/interprocess]condition_any implemented" </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Ion Gaztañaga</dc:creator> <pubDate>Sat, 09 Feb 2013 17:44:58 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7682#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7682#comment:3</guid> <description> <p> Thanks for the report. It was also reported in <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/8008" title="#8008: Bugs: boost named_condition under Windows (closed: duplicate)">#8008</a>. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Ion Gaztañaga</dc:creator> <pubDate>Sat, 09 Feb 2013 17:45:11 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/7682#comment:4 https://svn.boost.org/trac10/ticket/7682#comment:4 <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">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/82796" title="Fixes #7682">[82796]</a>) Fixes <a class="reopened ticket" href="https://svn.boost.org/trac10/ticket/7682" title="#7682: Bugs: boost 1.52 named_mutex/named_condition pairing broken (reopened)">#7682</a> </p> Ticket Jeff Trull <edaskel@…> Sat, 09 Feb 2013 19:17:14 GMT <link>https://svn.boost.org/trac10/ticket/7682#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7682#comment:5</guid> <description> <p> I can confirm this works in trunk now </p> </description> <category>Ticket</category> </item> <item> <author>ravi.bhoite@…</author> <pubDate>Tue, 15 Dec 2015 07:09:22 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7682#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7682#comment:6</guid> <description> <p> It doesn't work on 1.55.0. I have verified it on Boost 1.55.0. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Wed, 16 Dec 2015 05:40:57 GMT</pubDate> <title>status changed; resolution deleted https://svn.boost.org/trac10/ticket/7682#comment:7 https://svn.boost.org/trac10/ticket/7682#comment:7 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">fixed</span> </li> </ul> <p> reopening the issue </p> Ticket Ion Gaztañaga Wed, 23 Dec 2015 23:35:03 GMT <link>https://svn.boost.org/trac10/ticket/7682#comment:8 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7682#comment:8</guid> <description> <p> Can you please elaborate what is not working? Current version seems to works perfectly. Boost 1.55 is two years old, can you please check that currect version (1.60.0) works as expected for you? </p> </description> <category>Ticket</category> </item> </channel> </rss>