In a multi-master system (like a dual-core CPU), two masters might try to update the same memory location (e.g., a Semaphore or Spin-lock) at the same time. Without atomicity, you get a "Read-Modify-Write" race condition.
The Race Condition Scenario
- Master A reads Address 0x100 (Value = 0).
- Master B reads Address 0x100 (Value = 0) before A writes back.
- Master A writes 1 to 0x100.
- Master B writes 1 to 0x100.
- Result: Both think they acquired the lock, but only one should have!