Thread - contention vs race
-
29-09-2020 - |
Question
The terms contention
and race
are used interchangeably when it comes to thread's state(at critical section). Are they same?
Solution
These are two distinct phenomena. Contention refers to the fact that when thread $A$ has accessed a resource $B$ needs to wait until $A$ frees it.
Race refers to the fact when both threads $A$ and $B$ want to secure access to a resource. The fastest will secure it and thus lead to contention.
Licensed under: CC-BY-SA with attribution
Not affiliated with cs.stackexchange