std::experi...flex_barrier(3)
β¨ NAME β¨
okay so this is the manual page for std::experi...flex_barrier(3) from the C++ Standard Libary, and the name up top is literally std::experimental::flex_barrier β std::experimental::flex_barrier. same on both sides, no cap, iconic π
π¦ Synopsis π¦
Defined in header <experimental/barrier>
class flex_barrier; (concurrency TS)
std::experimental::flex_barrier is this class that provides a thread-coordination mechanism: it allows a set of participating threads to block until an operation is completed. bestie, it's giving "everyone wait here until the group project is done" energy π«Ά
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. so yes, you can run it back β literally reusable, slay β¨
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.
std::experimental::flex_barrier allows the user to control the completion phase with a function object. If the function object returns -1, the set of participating threads is unchanged (and the same set of participating threads must arrive at the synchronization point in the next cycle); otherwise the set of participating threads becomes a new set with a size equal to the returned value N, and consists of the next N threads to arrive at the barrier's synchronization point. that's the whole flex, iykyk π
Users who do not need this functionality can use std::experimental::barrier. simple. clean. no drama π
π Member functions π
constructorβ constructs aflex_barrier(public member function) π οΈdestructorβ destroys theflex_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) π
okay that's the whole page bestie π β source/version http://cppreference.com, dated 2024.06.10, for std::experi...flex_barrier(3). mwah π«ΆπΈ
π¦ 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