Seeking Consistency


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

Detecting memory corruption with dog tags

Posted on 2016-05-08

There's a fantastic technique I've used in my C days that attempted to detect memory corruption. It's a cheap and usually effective technique because it relies on common causes of corruption, namely off by one or any bound writes into memory beyond your allocated limit or even pointer arithmetic gone a-rye. It works by whenever you allocate memory you write a tag at the start and end. This can be anything but should be big enough such that it's unlikely...

Continue Reading

Considering High Availability

Posted on 2013-05-22

High Availability (HA) is a fantastic topic. It's often an overlooked topic in the world of performance. It's not as sexy as low latency nor as impressive as high throughput. Yet so many business processes can be significantly adversely impacted by an unavailable application. This is especially true in auto pricing systems employed by banks. Downtime for them means they're not competing in the market and they're not reaching their customer base. This not only represents a missed opportunity but...

Continue Reading