⚖
Fig 3 — Snapshot Algorithm Comparison: Double-Collect vs MCAS
Double-Collect
MCAS-Based Snapshot
collect₁
Read all N slots (timestamps + values)
collect₂
Read all N slots again
equal?
timestamps
yes
Return collect₁ as snapshot
no → retry
Complexity
O(N²) reads worst-case; requires
separate timestamp per slot
speculative read
Array.map Mcas_volatile.get slots
build identity ops
make_cas slot ~expected:v ~desired:v
for each slot i
Mcas_volatile.mcas ops
validates all N slots atomically
mcas
true?
yes
Return snapshot
no → scan t