False Sharing

Turkish equivalent: Sahte paylaşımDomain: Performance Engineering

False Sharing — A cache-coherence performance problem where independent variables updated by different cores occupy the same cache line and cause unnecessary ownership transfers.

Why Independent Data Can Contend

Two threads can update different variables and still interfere when those variables share a cache line. Each write can invalidate the other core's copy, forcing the line to move repeatedly between cores.

No logical lock conflict is required; the contention exists at the coherence granularity.

Diagnosis

High coherence traffic, poor scaling and a layout-sensitive slowdown are common clues. Padding or reorganizing hot per-thread state can help when measurement confirms the cause.

Padding everything blindly increases memory footprint and can damage locality, so the cache-line hypothesis should be validated.