[Boost-bugs] [Boost C++ Libraries] #1231: interprocess_condition (emulated) hangs after notify_all().

Subject: [Boost-bugs] [Boost C++ Libraries] #1231: interprocess_condition (emulated) hangs after notify_all().
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2007-09-04 16:40:36


#1231: interprocess_condition (emulated) hangs after notify_all().
-------------------------------------+--------------------------------------
 Reporter: atack2_at_[hidden] | Owner: igaztanaga
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: interprocess
  Version: Boost Development Trunk | Severity: Regression
 Keywords: |
-------------------------------------+--------------------------------------
 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_at_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_at_39114#L32
 m_count] threads wait on a condition variable. When the
 [source:trunk/boost/interprocess/sync/emulation/interprocess_barrier.hpp_at_39114#L32
 m_count'th] thread arrives, all threads are notified by a call to
 [source:trunk/boost/interprocess/sync/emulation/interprocess_condition.hpp_at_39114#L35
 interprocess_condition::notify_all()].

 The problem has been thus-far reduced to incorrect handling of entry/exit
 conditions in
 [source:trunk/boost/interprocess/sync/emulation/interprocess_condition.hpp_at_39114#L79
 interprocess_condition::do_timed_wait()]. Additionally, when
 [source:trunk/libs/interprocess/test/barrier_test.cpp_at_38329 barrier_test]
 is run with a small number of threads (such as
 [source:trunk/libs/interprocess/test/barrier_test.cpp_at_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.

 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.

--
Ticket URL: <http://svn.boost.org/trac/boost/ticket/1231>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.


This archive was generated by hypermail 2.1.7 : 2017-02-16 18:49:56 UTC