|
From: Christoph B. <bar...@or...> - 2009-02-05 18:35:38
|
Am Donnerstag, 5. Februar 2009 schrieb tom fogal: > I'm getting a bit off topic, but .. > > Perhaps I'm just not understanding the linked-to discussion, but given > this interpretation -- how could one ever delete a barrier? > > It sounds like the only safe way to destroy the barrier is if you've > joined every thread which could have possibly used it. Given that > constraint, I'm not sure how real world software could reasonably deal > with this. > > So is the idea essentially that we might as well forget about > destroying barriers? What am I missing? 1. There is the proposal to fix the standard by allowing the thread that gets the return value of PTHREAD_BARRIER_SERIAL_THREAD to destroy the barrier. 2. You can delete the barrier as soon as you know that all threads left the call to pthread_barrier_wait(). This can be done by other synchronisation primitives like another barrier, a lock, a condvar or a join. Christoph |