C++20 Concurrency-5: Barrier

Gajendra Gulgulia
7 min readOct 4, 2022

In the previous article I discussed about std::latch which is one of the two blocking synchronization primitives introduced in C++20 that can act on multiple threads. The second one being std::barrier . Fundamentally, both needs to be initialized with a counter and can block multiple threads until the counter reaches zero. The only fundamental difference between std::latch and std::barrier is that the latter can be reused multiple times.

--

--