Practice free →
Home › In CPU profiling, FALSE SHARING (cache-line ping…

In CPU profiling, FALSE SHARING (cache-line ping-pong) between threads is best fixed by which?

AUse thread-local storage for every variable always
BPad / align hot per-thread fields to separate cache lines
CPin all threads to the same CPU core (zero migration)
DSwitch to a single-threaded execution model entirely
Answer & Solution
Correct answer: B. Pad / align hot per-thread fields to separate cache lines
Intel Optimization Manual: two threads writing variables on the same cache line (typically 64 B) force coherence traffic. Pad to separate lines for hot counters.
Solve this in the app — Practice practice & 24k+ MCQs →
Related questions