Lecture 7 - Condition Variables Flashcards

1
Q

What are condition variables?

A

synchronisation mechanism used to wait for a condition to become true without busy waiting

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is busy waiting?

A

looping while holding lock, while could lead to deadlock.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What statement do we use to wait for a condition to become true in C++ ? hint : opposite than c

A

cv.wait(m, { return cond; });

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does the _.notify_one() statement means?

A

When a condition has been met we notify all waiting threads, so they can continue execution.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly