Mutual Exclusion
Before we look into the solution, let's define some terminology.
Mutual exclusion prevents multiple threads from accessing the same shared resource at the same time.
The critical section is code that only one thread can execute at a time.
A lock is a mechanism to realize mutual exclusion.
Last updated