Skip to content
Free public beta until December 4, 2026: every course is open, no card needed. After that, the first chapter of each course stays free and full access is a one-time $39 ($19 for up to 100 founding members chosen for helpful feedback). Your progress is kept. How the beta works

spurious failure

When a compare-and-swap (or store-conditional) reports failure even though the value was the expected one, which is allowed, so the code must retry.

A spurious failure is a failed compare_exchange_weak or store-conditional although memory held the expected value (for example, the exclusive monitor was cleared by an interrupt); compare_exchange_weak permits it so it can compile to a single LL/SC attempt inside the caller's loop.

Examples

  • ARM64's stxr can fail even when no other core touched the variable, so the loop around it simply retries.

Read the full section →