Skip to content

Nondeterminism

Category: Foundations · Status: stub

One line: The same program with the same input gives different results on different runs, because the scheduler chose a different interleaving.

Also called: non-deterministic behaviour.

How it connects

flowchart LR
  n_heisenbug["Heisenbug"]
  n_nondeterminism["Nondeterminism"]
  n_nondeterminism -->|can cause| n_heisenbug
  classDef center stroke-width:3px
  class n_nondeterminism center
  classDef outside stroke-dasharray: 4 3
  class n_heisenbug outside

In each language

Go The spec makes select choose among ready cases by uniform pseudo-random selection, and leaves map iteration order ↗ unspecified

Where to read more