Three sellers wait in line. Ann asks $101 and arrived first. Ben asks $100 and arrived second. Cal asks $100 and arrived third. Each offers 5 shares. Now a buyer arrives wanting 8 shares and will pay up to $101.
Rule: best price first, then earliest arrival first at the same price.
Workers inside a chip, called cores, receive orders from traders. Three senders can share one book under a padlock. Or each sender can put orders on its own ring of slots for a single matching core to read. Try the padlock first. Then watch for the moment an order becomes safe to read.
Sender 1’s ring. Ready marks the start of the next slot to write. The sender writes the whole order there, then moves Ready past it. The matcher can now read that filled slot and release it for reuse. The other senders keep writing to their own rings.
Each core keeps a count of the orders it handled. Core A updates Count A. Core B updates Count B. Memory moves between cores in small strips, and a core must hold the whole strip to write on it. What if both counts sit on the same strip?
Here a write takes 5 time units if the core must fetch the strip, or 1 unit if it already holds the strip.
Eight orders wait at one price. A trader wants to cancel the sixth. Their slot ticket says slot #6, version 1. The number gives its storage address. The version identifies which order occupied that slot. Each order also has links to the neighbors ahead of it and behind it.
Trader’s slot ticket slot #6, version 1
The engine writes every incoming message on a numbered tape before acting on it. After message 3 it also saved a picture of the book. Then it crashed after message 5. To recover, it loads the picture and replays part of the tape.