CyclicBarrier actions can break
If a barrier action fails or a waiting thread times out, the barrier becomes broken and other waiters receive BrokenBarrierException. Handle the broken state and coordinate a fresh cycle.
Appreciate the write-up on "CyclicBarrier actions can break". Useful for anyone using java / concurrency.
Goldmine
Brilliant
- @sohmeh▲ 1
Appreciate the write-up on "CyclicBarrier actions can break". Useful for anyone using java / concurrency.
Informative
A timed-out waiter or a failing barrier action breaks the whole CyclicBarrier, so every other thread sees BrokenBarrierException. Plan for a reset step that rebuilds the barrier before the next round.
When a barrier action throws or a waiter times out, the barrier enters a broken state and other waiters get BrokenBarrierException. Detect that state and agree on how the next cycle starts.
CyclicBarrier.reset()starts a fresh cycle after a break, but it also breaks any threads currently waiting. Corrections or other cases welcome below.Appreciate the write-up on "CyclicBarrier actions can break". Useful for anyone using java / concurrency.
Appreciate the write-up on "CyclicBarrier actions can break". Useful for anyone using java / concurrency.
Specific and to the point: "CyclicBarrier actions can break". Worth a look if you touch java / concurrency.
Clear note on java / concurrency. "CyclicBarrier actions can break" is the kind of detail that is easy to overlook.