Re: [boost] [Interprocess] barrier_test hanging on Apple PowerPC

I remember fixing another PPC atomics.hpp issue a while ago, I'll look at it tonight. Where can I read about running the tests? I've not played with that before. -- Tack ---- Original message ----
Date: Tue, 21 Aug 2007 21:33:30 +0200 From: Ion Gaztañaga <igaztanaga@gmail.com> Subject: Re: [boost] [Interprocess] barrier_test hanging on Apple PowerPC To: "boost@lists.boost.org" <boost@lists.boost.org>
Doug Gregor wrote:
The problem only seems to occur on PowerPC Mac, because the test is running fine on my Intel Mac. There's a gdb dump of the backtraces for all running threads below.
Removed from SVN.
The main problem is that Mac does not have process-shared barrier/mutexes/condition variables and an emulation using spinlocks is used. Since my knowledge about atomic operations is *zero* my implementation of interprocess_condition might be wrong or just the atomic operations I'm using are not correctly implemented.
I guess I should ask Boost thread-experts (Boost.Thread maintainers willing to help?) to write these synchronization primitives for me or/and beg for a simple atomic operation package in Boost. At least some that implement increment, cas, decrement, atomic read and read (full barrier semantics are enough for me, I just don't understand what acquire and release are ;-) ).
The implementation of the emulated barrier is pretty simple:
inline barrier::barrier(unsigned int count) : m_threshold(count), m_count(count), m_generation(0) { if (count == 0) throw std::invalid_argument("count cannot be zero."); }
inline bool barrier::wait() { scoped_lock<interprocess_mutex> lock(m_mutex); unsigned int gen = m_generation;
if (--m_count == 0){ m_generation++; m_count = m_threshold; m_cond.notify_all(); return true; }
while (gen == m_generation){ m_cond.wait(lock); } return false; }
so I guess there is problem with my emulated condition implementation or with atomic operations (which are taken from apache run-time library).
Regards,
Ion _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/ boost

atack2@uiuc.edu wrote:
I remember fixing another PPC atomics.hpp issue a while ago, I'll look at it tonight.
Where can I read about running the tests? I've not played with that before.
cd boost-root/libs/interprocess/test bjam barrier_test
Would have worked... Except that that Ion removed the source file, since he auto-generates the tests based on the source files. So I guess you'd have to get the barrier_test.cpp file first. -- -- Grafik - Don't Assume Anything -- Redshift Software, Inc. - http://redshift-software.com -- rrivera/acm.org - grafik/redshift-software.com -- 102708583/icq - grafikrobot/aim - grafikrobot/yahoo

Has this issue been resolved? I don't see any activity on this issue and the threading issue is appearing on PowerPC projects. -- -Jaime http://www.jaimerios.com

Jaime Rios wrote:
Has this issue been resolved? I don't see any activity on this issue and the threading issue is appearing on PowerPC projects.
Sorry, I was just distracted by other bugs and libraries. I've looked at it a bit but I have no clue on what can be wrong. The issue has only appeared in PowerPC and have no access to this platform. Hopefully, Tack is willing to help (thanks!). Regards, Ion
participants (4)
-
atack2@uiuc.edu
-
Ion Gaztañaga
-
Jaime Rios
-
Rene Rivera