Safe Publication

Initialize → atomic pointer Store → observing Load → read immutable data. Name the exact ordering edge.

1 / 5

Empty differs from zero

Empty Load →(0,false). Store(0), then Load →(0,true). Swap(7) then returns(0,true). A nil receiver is explicitly harmless, not an empty snapshot object.

2 / 5

Race freedom is not an atomic compound operation

Cell10: A loads10; B loads10; A stores20; B stores30. Both return10: impossible for two true swaps. Use one atomic replacement to return the displaced snapshot.

3 / 5

Observation matters

Receiving an old buffered token need not observe a later close. Publishing an atomic pointer does not synchronize later mutation of its map. Keep snapshots immutable after publication.

4 / 5

Independent check

Two swaps install8 and12 from initial4. Final value is8. Derive both returned predecessors. Then extend publication to a map and specify how caller mutation is prevented.

5 / 5
←/→ or click edges to navigate · ? help · N notes · F fullscreen