Synchronization

  • ◷ 8 min
  • Beginner
  • 12 steps

Two increments should produce two. Watch one disappear, then protect the whole operation.

Shared counter
0
Completed increments
0
Lost updates
0
  • Thread A
  • Thread B
  • Protected update