#
A barrier is a thread coordination mechanism whose lifetime consists of a sequence of barrier phases, where each phase allows at most an expected number of threads to block until the expected number of threads arrive at the barrier
.
[
Note
1
:
A barrier is useful for managing repeated tasks that are handled by multiple threads
.
—
end note
]