std::atomic...:notify_all(3)

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

✨ NAME ✨

okay so bestie, welcome to std::atomic...:notify_all(3) from the C++ Standard Libary manual πŸ’… β€” the actual star of the page is std::atomic_flag::notify_all. That’s the name, that’s the vibe, periodt.

🌸 Synopsis 🌸

void notify_all() noexcept;          (1) (since C++20)
void notify_all() volatile noexcept; (2) (since C++20)

It performs atomic notifying operations ✨

What does that mean? It unblocks all threads that are blocked in atomic waiting operations (i.e. wait()) on *this, if there are any; otherwise it does nothing. Literally nothing. A whole lot of nothing. 🫢

πŸ¦‹ Return value πŸ¦‹

(none) β€” yep, it returns absolutely nothing, and that’s iconic of it.

πŸŽ€ Notes πŸŽ€

This form of change-detection is often more efficient than simple polling or pure spinlocks. No cap, that’s the note. πŸ’–

😭 Example 😭

This section is incomplete.

Reason: no example 🫠

πŸ”₯ See also πŸ”₯

  • wait β€” blocks the thread until notified and the atomic value changes. (C++20) (public member function)
  • atomic_flag_wait β€” (C++20)
  • atomic_flag_wait_explicit β€” blocks the thread until notified and the flag changes. (C++20) (function)
  • atomic_flag_notify_one β€” notifies a thread blocked in atomic_flag_wait. (C++20) (function)

🧚 Category 🧚

  • Todo no example

mwah πŸ’‹ this page is from http://cppreference.com, version/date 2024.06.10, and its footer title is std::atomic...:notify_all(3). Slay. πŸŒˆπŸ‘‘

πŸ“¦ where this page comes from