IT lexicon › Programming › True sharing

True sharing

Programming På svenska → Updated: 2026-11-16

When two threads actually update the same data value and must synchronize.

Unlike false sharing, this is a genuine conflict — two threads need the same value, and changes from one must be visible to the other. It's resolved through locks, atomic operations, or happens-before guarantees from the memory model.

True sharing is often intentional — for example, a counter or status variable that many threads update. Problems arise when it becomes a bottleneck: if a lock-protected counter is updated by a thousand threads, each sees the others waiting. Often it's better to let each thread maintain its own local counter and merge later (the reduce pattern).

← Back to the lexicon