What’s the difference between notify_all() and notify_one() of std::condition_variable?

If there are ten threads blocked on the condition variable, for example, notify_one() will unblock only one thread, while notify_all() will unblock them all. In your case, you’ll want to use notify_one() so you don’t wake up threads that don’t have any work waiting for them.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)