Top "Condition-variable" questions

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

How can you implement a condition variable using semaphores?

A while back I was thinking about how to implement various synchronization primitives in terms of one another. For example, …

algorithm mutex semaphore condition-variable
Using std::conditional_variable to wait on a condition

For simplicity, let's assume that we have only one conditional variable to match a single condition that is reflected by …

c++ multithreading c++11 blocking condition-variable
Please explain the use of condition variables in c++ threads, and why do we need to use `unique_lock` and `mutex` alongwith this

I am refering to this particular piece of code: this code basically has three threads 1. Perform some handshaking with server 2. …

c++ multithreading condition-variable
What is the difference between std::condition_variable::wait_for and std::condition_variable::wait_until?

The reference I'm using explains the two in the following way: wait_for "blocks the current thread until the condition …

c++ multithreading c++11 condition-variable
what if notify() is called before wait()?

I have a situation where a notify() 'can' be called before a wait(). I am trying to make a simulator …

c++ boost synchronization condition-variable ns-3
signal on condition variable without holding lock

So I just found out that it's legal to signal a condition variable if you're not holding the lock in …

c++ multithreading c++11 condition-variable
condition variable

What are the principles of a condition variable in synchronization of the processes of operating systems?

synchronization operating-system condition-variable
Using std::mutex, std::condition_variable and std::unique_lock

I'm having some trouble understanding condition variables and their use with mutexes, I hope the community can help me with. …

c++ multithreading concurrency mutex condition-variable
POSIX Threads: Condition Variables - what's the point?

I've been working with pthreads a fair bit recently and there's one little thing I still don't quite get. I …

pthreads condition-variable
std::condition_variable::wait with predicate

In the documentation for std::condition_variable, there is an overload of wait() taking as argument a predicate function. The …

c++ multithreading c++11 std condition-variable