title: What's the difference between notify_all() and notify_one() of std::condition_variable?
body: <p>Currently, I am implementing a multi-thread project using <code>std::thread</code> in C++11. I use <code>std::condition_variable</code> to synchronize threads. In detail, one consumer function calls <code>wait()</code> member function of <code>std::condition_variable</code> to wait for task from a global task queue, another producer function generates and puts tasks into the queue. But I do not know the difference between <code>notify_all()</code> and <code>notify_one()</code> member functions of <code>std::condition_variable</code>. Which function should I use in the producer function? Thanks!</p>