Ticket on-sale

The race

Two stores with 500 seats each sell to bots at the same time, through the same queue and the same test-stub bank. The naive store checks a seat in app code before it writes it, and charges at once on a plain timer. This store takes a seat only if it is still free in that same write, and captures the charge only once the ticket exists.

Times compressed for the race: a hold lasts 20 s instead of 8 minutes, and some bank screens take longer than that.

Checking for a race…

naive store
seats sold–
tickets issued–
oversold–
charged for a lost seat–
this store
seats sold–
tickets issued–
oversold–
charged for a lost seat–