Posts

Showing posts with the label mechanical sympathy

This Blog Has Moved!

Right, so yes, five years ago I moved to github pages, and never bothered to redirect any of these pages there. Now I've moved on from there, and... Finally I am using my real domain, trishagee.com . My blog is now at trishagee.com/blog .  See you there!

How Mechanical Sympathy got me to the airport on time

Image
Lets talk about mechanical sympathy.  Martin Thompson has been making this term very popular in software development, so it's best to read his description of why he used the term . I had a perfect example yesterday.  I'm about to drive to the airport and the car won't move (I'm a modern tomboy, I can write  stories about hair  and stories about cars). Not at all.  It's stuck.  I can't reverse out of my parking space. The first thing that occurs to me is something is stuck under the car.  Like a cat.  Those buggers hide in the stupidest of places.  So I get out and check there's nothing wedged against the wheels, which seems like the most logical thing that would stop the car moving. (OK that's not true.  The first thing that occurs to me is oh-my-god-I'm-going-to-miss-my-plane-and-I-haven't-got-a-backup-plan-to-get-to-the-airport-and-I've-already-paid-for-parking-and-I-would-like-to-cry-now-but-that's-not-goi...

Dissecting the Disruptor: Demystifying Memory Barriers

Image
My recent slow-down in posting is because I've been trying to write a post explaining memory barriers and their applicability in the Disruptor . The problem is, no matter how much I read and no matter how many times I ask the ever-patient Martin and Mike questions trying to clarify some point, I just don't intuitively grasp the subject. I guess I don't have the deep background knowledge required to fully understand. So, rather than make an idiot of myself trying to explain something I don't really get, I'm going to try and cover, at an abstract / massive-simplification level, what I do understand in the area.  Martin has written a post  going into memory barriers  in some detail, so hopefully I can get away with skimming the subject. Disclaimer: any errors in the explanation are completely my own, and no reflection on the implementation of the Disruptor or on the LMAX guys who actually do know about this stuff. What's the point? My main aim in this s...

Dissecting the Disruptor: Why it's so fast (part two) - Magic cache line padding

Image
We mention the phrase Mechanical Sympathy quite a lot, in fact it's even Martin's blog title .  It's about understanding how the underlying hardware operates and programming in a way that works with that, not against it. We get a number of comments and questions about the mysterious cache line padding in the RingBuffer , and I referred to it in the last post .  Since this lends itself to pretty pictures, it's the next thing I thought I would tackle. Comp Sci 101 One of the things I love about working at LMAX is all that stuff I learnt at university and in my A Level Computing actually means something.  So often as a developer you can get away with not understanding the CPU, data structures or Big O notation  - I spent 10 years of my career forgetting all that.  But it turns out that if you do know about these things, and you apply that knowledge, you can come up with some very clever, very fast code. So, a refresher for those of us who studied this at sc...

Popular posts from this blog

Dissecting the Disruptor: What's so special about a ring buffer?

Dissecting the Disruptor: Writing to the ring buffer

Dissecting the Disruptor: Demystifying Memory Barriers