std::atomic::notify_all(3)
π std::atomic::notify_all(3) π
okay so bestie, this page is from the C++ Standard Libary manual (yes, that spelling is exactly what the original says, not me π). itβs giving concurrency, itβs giving C++20, and itβs literally called std::atomic::notify_all.
π NAME π
std::atomic::notify_all - std::atomic::notify_all β yes, the name and the one-liner are the same thing twice, and honestly? iconic. π
β¨ Synopsis β¨
void notify_all() noexcept; (1) (since C++20)
void notify_all() volatile noexcept; (2) (since C++20)
so what does it do? it performs atomic notifying operations. thatβs the main character move. π
it unblocks all threads blocked in atomic waiting operations (i.e. wait()) on *this, if there are any; otherwise it does nothing. thatβs it. no cap. π«Ά
π Return value π
(none) β literally none. nothing. zero. the void is voiding. π
π Notes π
this form of change-detection is often more efficient than simple polling or pure spinlocks. periodt. thatβs the note, bestie β itβs giving efficient, itβs giving not-spinning-forever. β¨
πΈ Example πΈ
This section is incomplete. Reason: no example. π so thereβs literally no example here β itβs in the todo pile, bestie.
π See also π
waitβ blocks the thread until notified and the atomic value changes(C++20)(public member function)atomic_waitβ(C++20)atomic_wait_explicitβ blocks the thread until notified and the atomic value changes(C++20)(function template)atomic_notify_oneβ notifies a thread blocked inatomic_wait(C++20)(function template)
π·οΈ Category π·οΈ
* Todo no example
signed off from http://cppreference.com on 2024.06.10, page std::atomic::notify_all(3) π
β¨
π¦ 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