std::experi...flex_barrier(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

✨ 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 a flex_barrier (public member function) πŸ› οΈ
  • destructor β€” destroys the flex_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