Author jyasskin
Recipients jyasskin, kristjan.jonsson
Date 2010-05-24.17:30:53
SpamBayes Score 0.0324426
Marked as misclassified No
Message-id <1274722292.85.0.285933641571.issue8777@psf.upfronthosting.co.za>
In-reply-to
Content
You should probably mention that pthread_barrier and java.util.concurrent.CyclicBarrier are prior art for this. I'm thinking about them when looking at the API to see whether your differences make sense.

"enter" seems to be the wrong term for this, since there's no matching "exit" call. "wait" or "block" seem better.

Both pthread_barrier and CyclicBarrier provide a way to identify a unique thread from each group. pthread_barrier_wait returns true in exactly one thread, while CyclicBarrier runs a callback while all other threads are still paused. I'd be inclined to use CyclicBarrier's interface here, although then you have to define what happens when the action raises an exception.

_release should notify_all after its loop.

adjust_count makes me nervous. Is there a context manager interface that would make this cleaner/safer?
History
Date User Action Args
2010-05-24 17:31:33jyasskinsetrecipients: + jyasskin, kristjan.jonsson
2010-05-24 17:31:32jyasskinsetmessageid: <1274722292.85.0.285933641571.issue8777@psf.upfronthosting.co.za>
2010-05-24 17:30:54jyasskinlinkissue8777 messages
2010-05-24 17:30:53jyasskincreate