Top "Condition-variable" questions

A synchronisation primitive used in multithreaded programming to wait for a condition to be true.

C++11 thread-safe queue

A project I'm working on uses multiple threads to do work on a collection of files. Each thread can add …

c++ multithreading c++11 queue condition-variable
Why do pthreads’ condition variable functions require a mutex?

I’m reading up on pthread.h; the condition variable related functions (like pthread_cond_wait(3)) require a mutex as …

c pthreads mutex condition-variable
Calling pthread_cond_signal without locking mutex

I read somewhere that we should lock the mutex before calling pthread_cond_signal and unlock the mutex after calling …

c++ pthreads mutex signals condition-variable
Differences between Conditional variables, Mutexes and Locks

For example the c++0x interfaces I am having a hard time figuring out when to use which of these …

c++ multithreading c++11 mutex condition-variable
When is a condition variable needed, isn't a mutex enough?

I'm sure mutex isn't enough that's the reason the concept of condition variables exist; but it beats me and I'm …

multithreading operating-system synchronization mutex condition-variable
Share condition variable & mutex between processes: does mutex have to locked before?

I need to some little help to understand how to use condition variables in C to resolve an exercise. Here …

c pthreads ipc mutex condition-variable
Do I have to acquire lock before calling condition_variable.notify_one()?

I am a bit confused about the use of std::condition_variable. I understand I have to create a unique_…

c++ multithreading condition-variable
Usage example of boost::condition::timed_wait

Does someone have an example of how to most easily use boost::condition::timed_wait? There are some threads on …

c++ multithreading boost boost-thread condition-variable
Using condition variable in a producer-consumer situation

I'm trying to learn about condition variables and how to use it in a producer-consumer situation. I have a queue …

c++ boost multithreading condition-variable
What's the difference between notify_all() and notify_one() of std::condition_variable?

Currently, I am implementing a multi-thread project using std::thread in C++11. I use std::condition_variable to synchronize threads. …

c++ multithreading c++11 condition-variable