std::experi...ive_and_drop(3)

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

πŸ’… NAME πŸ’…

std::experimental::barrier::arrive_and_drop β€” std::experimental::barrier::arrive_and_drop

Okay bestie, this page is from the C++ Standard Libary manual, and its title is std::experi...ive_and_drop(3). Yes, β€œLibary” is literally how it appears in the header β€” we don’t make the rules, we just stan the concurrency TS. πŸ’–


✨ Synopsis ✨

void arrive_and_drop();  (concurrency TS)

So what’s the vibe? You arrive at the barrier’s synchronization point, and you remove the current thread from the set of participating threads. It is unspecified whether this function blocks until the completion phase has ended. No cap. 🫢

Undefined behavior alert, bestie: the behavior is undefined if the calling thread is not in the set of participating threads of this barrier. Like, do not test fate. πŸ’€

Calls to arrive_and_drop synchronize with the start of the completion phase of the barrier. If the call blocks, then 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. That part is iconic, honestly. 🌈


πŸ’– Exceptions πŸ’–

Throws nothing. Literally nothing. Not even a little drama. 😌


πŸ¦‹ Notes πŸ¦‹

  • If every participating thread calls arrive_and_drop(), the barrier can only be destroyed. That’s the whole mood at that point. πŸŽ€
  • After a thread calls arrive_and_drop() on a barrier, it is no longer a member of its set of participating threads and hence can no longer call either arrive_and_drop() or arrive_and_wait() on the same barrier. Once you’ve left the group chat, you can’t keep sending messages. πŸ™ˆ

πŸ‘‘ See also πŸ‘‘

  • arrive_and_wait β€” arrive at the synchronization point and block (public member function)

Mwah πŸ’‹ β€” this cutie came from http://cppreference.com, dated 2024.06.10, and the footer label is std::experi...ive_and_drop(3). Byeee, go synchronize responsibly! πŸ’œ

πŸ“¦ where this page comes from