Question OS-SYNC-0057
Mediumx starts at 0. Thread A runs x = x + 2 twice; thread B runs x = x × 2 once. Each statement is atomic, but the threads interleave in any order. Which final value is NOT possible?
- A.
8
- B.
4
- C.
6
- D.
2
Sign up free to see the answer and a step-by-step explanation.