Question OS-SYNC-0020
HardTwo threads update two shared counters. Thread 1 locks A then B; thread 2 locks B then A. What is the risk, and the usual fix?
- A.
A race condition; remove both locks
- B.
Starvation; use more threads
- C.
Sign up free to see the answer and a step-by-step explanation.