Skip to content
All posts
Dynamic Dispatch Engineering

How two machines never double-book a driveway

The quiet engineering detail that makes automatic dispatch trustworthy: an atomic claim. A plain-English explanation of why races can’t send two vehicles to one property.

By The Snowmass Team

Most of what makes dynamic dispatch valuable is easy to explain: score the properties, send the best-placed machine, adapt as things change. But there is one detail underneath it that is easy to gloss over and absolutely essential to trust — the guarantee that two machines can never be sent to the same property. That guarantee has a name in software: the atomic claim. It is worth understanding, because it is the difference between a system you can rely on and one that occasionally embarrasses you.

The race condition problem

Picture two machines finishing nearby properties at the same instant. Both look for their next stop. Both score the same open property as their best option. In a naive system, both read "that property is available," both decide to take it, and both drive there — a wasted machine, an angry customer who got double-covered while their neighbor got skipped, and a dispatcher who cannot explain what happened. This is a race condition: two actors reaching for the same resource at the same moment, with nothing to arbitrate between them.

In a fast-moving fleet where scoring runs on every GPS ping, these near-simultaneous decisions are not rare edge cases. They are constant. So the arbitration cannot be an afterthought — it has to be built into the very act of claiming.

In a live dispatcher, two machines wanting the same property at the same instant is not an edge case — it is Tuesday. The claim mechanism has to assume it.

What "atomic" means

An atomic operation is one that cannot be interrupted or interleaved — it happens completely or not at all, with no in-between state another actor can slip into. An atomic claim makes taking a property a single, indivisible database operation that succeeds for exactly one machine. Concretely, claiming a property is a conditional update: "mark this property as mine, but only if it is still unclaimed." The database processes these one at a time. The first machine's update finds the property unclaimed and succeeds. The second machine's update finds it already claimed and does nothing — and the machine sees that it lost and simply moves to its next-best property.

The row count is the referee

The elegant part is how a machine knows whether it won. The update reports how many rows it changed. One row changed means "you got it." Zero rows changed means "someone beat you — move on." There is no separate check-then-act with a gap in between for a race to sneak through; the check and the act are the same operation. That collapse of check-and-act into one indivisible step is exactly what makes double-booking structurally impossible rather than merely unlikely.

Why this earns trust

This is the kind of detail that does not show up in a demo but decides whether a system is dependable in production. An operation that has been burned by flaky software is right to ask "what stops two machines from colliding?" The honest, technical answer — that the claim is atomic, arbitrated by the database itself, and that losing a race is a normal, handled outcome rather than a bug — is what separates a real dispatcher from a hopeful one. Reliability under contention is not a feature you can bolt on later; it has to be the foundation the whole swarm stands on.

Key takeaways

  • Two machines wanting the same property at the same instant is constant in a live dispatcher, not a rare edge case.
  • An atomic claim makes taking a property a single indivisible database operation that succeeds for exactly one machine.
  • The update's row count is the referee: one row means you won, zero means you lost and move on — no gap for a race to exploit.
  • This makes double-booking structurally impossible, and that reliability under contention is the foundation the swarm stands on.

Ready before the next storm

Run a simulation scaled to your fleet, or talk to the team about the season.