Why pad by 128 bytes?

Posted on 2019-03-11

False sharing is where two fields occupy the same cache line and are accessed by separate threads and where at least one thread performs writes. The net effect is that writer threads frequently invalidate that cache line on other cores. This is where padding comes in. Everyone knows that a cache line is 64 bytes, so surely to ensure two fields are on different cache lines you need only pad by 64 bytes? Not quite. Intel has this great feature...

Continue Reading