std::experi...ive_and_wait(3)
π NAME
std::experimental::barrier::arrive_and_wait β like, literally std::experimental::barrier::arrive_and_wait. Bestie, this page lives in the C++ Standard Libary manual and it's the whole mood: you show up at the barrier, you wait, nobody's mad. π
β¨ Synopsis β¨
void arrive_and_wait(); (concurrency TS)
Blocks and arrive at the barrier's synchronization point. π
β οΈ The behavior is undefined if the calling thread is not in the set of participating threads of this barrier. Not "kinda weird", not "a little frowned upon" β undefined, bestie. Don't be that thread. π
Calls to arrive_and_wait synchronizes with the start of the completion phase of the barrier. The completion of the completion phase synchronizes with the return from the call. π¦
Calls to arrive_and_drop and arrive_and_wait never introduce data races with themselves or each other. No cap, they're safe like that. π
πΈ Notes πΈ
It is safe for a thread to call either arrive_and_wait() or arrive_and_drop() immediately on return from this call. It's not necessary to ensure that all blocked threads have exited arrive_and_wait() before a thread calls it again. Go off, icon, loop away. π
The set of participating threads for a barrier constructed for num_threads threads is the first num_threads to arrive at its synchronization point. This set does not change from cycle to cycle, except for threads removed from the set due to arrive_and_drop() calls. The roster is the roster β aside from the dropouts. πβ¨
π Exceptions π
Throws nothing. Not one thing. Zero. Nada. The calmest function in the whole standard library, honestly. π§ββοΈ
π See also π
arrive_and_dropβ arrive at the synchronization point and remove the current thread from the set of participating threads (public member function). It's giving "i was there but now i'm not". π
slay, that's the whole page, hope it was useful bestie π«Ά β sourced from http://cppreference.com, dated 2024.06.10, and filed under std::experi...ive_and_wait(3) in case you need to find it again. πβ
π¦ 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