Thread Safety

How Milo approaches free-threaded Python and shared mutable state.

1 min read 86 words

Milo is designed for Python 3.14t withPYTHON_GIL=0.

The core rule is simple: reducers do not mutate shared state or perform I/O. Effects run in sagas,Cmdthunks, command handlers, or explicit boundary code.

Important boundaries:

  • Reducers are pure functions.
  • State should be immutable or treated as immutable.
  • Store dispatch serializes action processing.
  • Sagas and commands run on an executor and report back through actions.
  • Terminal cleanup belongs to the app runtime, not reducers.

See App Lifecycle for the runtime flow.