Boost C++ Libraries: Ticket #1231: interprocess_condition (emulated) hangs after notify_all(). https://svn.boost.org/trac10/ticket/1231 <p> This bug has manifested itself in barrier_test execution on Mac OS (PPC) machines, where POSIX is not sufficiently implemented to support barriers at the kernel level. The [source:trunk/boost/interprocess/sync/emulation@39114 emulated synchronization primitives] are a basic implementation of the necessary primitives, based on spin-locks. Barriers are implemented by having [source:trunk/boost/interprocess/sync/emulation/interprocess_barrier.hpp@39114#L32 m_count] threads wait on a condition variable. When the [source:trunk/boost/interprocess/sync/emulation/interprocess_barrier.hpp@39114#L32 m_count'th] thread arrives, all threads are notified by a call to [source:trunk/boost/interprocess/sync/emulation/interprocess_condition.hpp@39114#L35 interprocess_condition::notify_all()]. </p> <p> The problem has been thus-far reduced to incorrect handling of entry/exit conditions in [source:trunk/boost/interprocess/sync/emulation/interprocess_condition.hpp@39114#L79 interprocess_condition::do_timed_wait()]. Additionally, when [source:trunk/libs/interprocess/test/barrier_test.cpp@38329 barrier_test] is run with a small number of threads (such as [source:trunk/libs/interprocess/test/barrier_test.cpp@38329#L32 N_THREADS]=2), and the help of std::cout, we can more easily see that one thread never completely enters the condition variable, or concurrency problems are causing std::cout calls to be useless. </p> <p> A final note: it appears that Mac OS supports the pthread condition variable. It may be worth allowing the test to run on Mac OS X PPC by using this primitive (known to work). This workaround does not close this ticket, but would solve the problem on that platform and be a valuable optimization. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/1231 Trac 1.4.3 atack2@… Tue, 04 Sep 2007 16:41:33 GMT <link>https://svn.boost.org/trac10/ticket/1231#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1231#comment:1</guid> <description> <p> I intend to solve this problem. It appears, however, that without a login, I cannot own this ticket. That's fine; I'll just watch it. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Ion Gaztañaga</dc:creator> <pubDate>Wed, 05 Sep 2007 16:13:38 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/1231#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1231#comment:2</guid> <description> <p> Mac OS supports the pthread condition variable, but does not support process-shared condition condition variables, so we can't use it for Boost.Interprocess. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Fri, 28 Dec 2007 07:14:51 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/1231#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1231#comment:3</guid> <description> <p> Ion: This was fixed in revision <a class="changeset" href="https://svn.boost.org/trac10/changeset/39957" title="Corrected bug in atomic_dec32 for PPC">[39957]</a>. How in the world did you figure out that bug? </p> </description> <category>Ticket</category> </item> <item> <author>atack2@…</author> <pubDate>Fri, 28 Dec 2007 07:16:53 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/1231#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1231#comment:4</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/1231#comment:3" title="Comment 3">anonymous</a>: </p> <blockquote class="citation"> <p> Ion: This was fixed in revision <a class="changeset" href="https://svn.boost.org/trac10/changeset/39957" title="Corrected bug in atomic_dec32 for PPC">[39957]</a>. How in the world did you figure out that bug? </p> </blockquote> <p> Sorry for the anonymous comment; this was from Tack. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Ion Gaztañaga</dc:creator> <pubDate>Fri, 28 Dec 2007 09:14:16 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/1231#comment:5 https://svn.boost.org/trac10/ticket/1231#comment:5 <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> All PPC regressions were failing so I started revising the only platform-dependent file related to interprocess_condition. A bit of intuition and a lot of work ;-) </p> Ticket atack2@… Wed, 02 Jan 2008 06:14:38 GMT <link>https://svn.boost.org/trac10/ticket/1231#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1231#comment:6</guid> <description> <p> You could re-include the [source:trunk/libs/interprocess/test/barrier_test.cpp@38329 barrier test], now that this is solved. Just being notice-y. </p> </description> <category>Ticket</category> </item> </channel> </rss>