std::experimental::barrier(3)
π NAME π
okay so bestie, this is the manual page for std::experimental::barrier β like, literally std::experimental::barrier β living in the C++ Standard Libary manual as std::experimental::barrier(3). Yes, the header spells it βLibaryβ; we respect the source material, periodt. π
π¦ Synopsis π¦
Defined in header <experimental/barrier>
class barrier; (concurrency TS)
The class std::experimental::barrier provides a thread-coordination mechanism that lets a set of participating threads block until an operation is completed. Itβs giving βeveryone wait here until the group project is done,β lowkey. β¨
Unlike std::experimental::latch, barriers are reusable; once the participating threads are released from a barrierβs synchronization point, they can reuse the same barrier. No cap, thatβs iconic. π¦
A barrier has a completion phase, which is executed by one of the participating threads once all threads in the set of participating threads arrive at the synchronization point. The arrive_and_wait and arrive_and_drop calls synchronize with the start of the completion phase; the end of the completion phase synchronizes with the returns from all calls blocked by its completion.
For std::experimental::barrier, the completion phase is empty. std::experimental::flex_barrier allows the user to control the completion phase with a function object. πΈ
The set of participating threads for a barrier constructed for num_threads threads is the first num_threads threads to arrive at its synchronization point after construction. The same set of threads (except for threads that called arrive_and_drop()) must arrive at the barrier each cycle. No switching up the squad mid-cycle, bestie. π
π Member functions π
constructorβ constructs a barrier (public member function)destructorβ destroys the barrier (public member function)operator=β not copy-assignable,[deleted](public member function)arrive_and_waitβ arrive at the synchronization point and block (public member function)arrive_and_dropβ arrive at the synchronization point and remove the current thread from the set of participating threads (public member function)
source: http://cppreference.com Β· version/date: 2024.06.10 Β· page: std::experimental::barrier(3) β bye bestie, go coordinate those threads π«Άπ
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms