Rendered at 18:15:32 GMT+0000 (Coordinated Universal Time) with Cloudflare Workers.
anematode 16 hours ago [-]
Congrats to the author! :)
dropdropteam 17 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.
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.