NHacker Next
  • new
  • past
  • show
  • ask
  • show
  • jobs
  • submit
▲Implementing 128-bit atomics in Cranelift (trifectatech.org)
anematode 7 hours ago [-]
Congrats to the author! :)
dropdropteam 8 hours ago [-]
One cost of this approach worth naming explicitly: the SeqCst load isn't really a load at the hardware level. The stxp writes the value back, so a load creates a new entry in the location's modification order and can make another core's ldaxp/stxp sequence fail and retry — read contention becomes write contention. It also means a contended load can spin, where a plain ldar never retries.

That's not an objection — as the post explains, ldar alone only gives acquire, so the loop is what buys the total order Wasm needs — but it does mean the fallback isn't free, and it's a good reason to prefer the better code the post mentions when LSE or LSE128 is enabled.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact
Rendered at 08:58:46 GMT+0000 (Coordinated Universal Time) with Vercel.