Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::experimental::flex_barrier

      From cppreference.com
      <cpp‎ |experimental
      Merged into ISO C++ The functionality described on this page was merged into the mainline ISO C++ standard as of 7/2019; seestd::barrier(since C++20)
       
       
       
       
       
      Defined in header<experimental/barrier>
      class flex_barrier;
      (concurrency TS)

      The classstd::experimental::flex_barrier provides a thread-coordination mechanism that allows a set of participating threads to block until an operation is completed. Unlikestd::experimental::latch, barriers are reusable; once the participating threads are released from a barrier's synchronization point, they can reuse the same barrier.

      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. Thearrive_and_wait andarrive_and_drop callssynchronize 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 valueN, and consists of the nextN threads to arrive at the barrier's synchronization point.

      Users who do not need this functionality can usestd::experimental::barrier.

      [edit]Member functions

      constructs aflex_barrier
      (public member function)[edit]
      destroys theflex_barrier
      (public member function)[edit]
      operator=
      [deleted]
      not copy-assignable
      (public member function)[edit]
      arrive at the synchronization point and block
      (public member function)[edit]
      arrive at the synchronization point and remove the current thread from the set of participating threads
      (public member function)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/experimental/flex_barrier&oldid=163716"

      [8]ページ先頭

      ©2009-2025 Movatter.jp