A synchronization method that stops a thread from proceeding until all other threads reach the barrier.

A barrier has a raised and lowered state and keeps track of the number of the number of threads that have arrived at the barrier and the number of threads that need to arrive at the barrier.

Barriers are “generational”, meaning that when N threads arrive, the barrier wakes up all those threads and then moves on to the next generation.