Message106375
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? |
|
Date |
User |
Action |
Args |
2010-05-24 17:31:33 | jyasskin | set | recipients:
+ jyasskin, kristjan.jonsson |
2010-05-24 17:31:32 | jyasskin | set | messageid: <1274722292.85.0.285933641571.issue8777@psf.upfronthosting.co.za> |
2010-05-24 17:30:54 | jyasskin | link | issue8777 messages |
2010-05-24 17:30:53 | jyasskin | create | |
|