← BYTES
Unix IPC·Starter·Ref: 15.1.81
What does 'false sharing' mean, at a basic level?
Have a question about this video? Mention reference 15.1.81 when you contact us.
a.A performance problem where two threads' UNRELATED variables happen to sit on the same CPU cache line, so modifying one variable forces the OTHER thread's cache of that line to be invalidated too, even though the data it actually cares about never changed
b.Two threads intentionally and correctly sharing the same variable on purpose
c.A bug where one thread claims ownership of data it never actually created
d.A feature that lets threads share data without any synchronization at all, safely
False sharing is a subtle performance bug, not a correctness bug: if two threads' separate, unrelated variables happen to land on the SAME CPU cache line, writes by one thread force cache invalidation that affects the OTHER thread too -- purely due to physical memory layout, not because the two threads are actually sharing any meaningful data.
Find this on YouTube & Instagram
Every BYTES video is tagged with its reference number and topic — search any of these on YouTube or Instagram to find this one:
#BYTES#BYTES15181#UnixIPC