pthreadbarriert
pthread_barrier_t, commonly referred to as a barrier in the POSIX threads (pthreads) library, is a synchronization primitive that coordinates a fixed set of threads. When a barrier is used, each participating thread must reach the barrier point and wait until all designated threads have arrived, at which point they all proceed. Barriers are reusable: after release, the barrier can be used again for subsequent rendezvous.
The typical usage involves creating a barrier with pthread_barrier_init, providing the number of threads that must
Destruction of the barrier is performed with pthread_barrier_destroy. It returns 0 on success. It may fail with
Portability and notes: Barriers are defined by POSIX, but availability and exact error semantics can vary by