Lecture 7 - Mutual Exclusion in C++ Flashcards
1
Q
What does mutual exclusion mean?
A
2 threads cannot simultanously enter a critical section
2
Q
Wht is mutual exclusion managed with?
A
Locks / Mutexes
We need to lock and unlock when accessing a critical section
3
Q
In C++ do we need to unlock? Why?
A
No
Unlocking is done automatically when block is finished, this is due to the RAll concept, as parent finishes execution.