Remix.run Logo
8by3 an hour ago

real people don't write "compare-and-swap" ... or "lo-and-behold" for that matter.

edit. Clearly the joke about "lo-and-behold" didn't land well with the bots...

ninjaoxygen an hour ago | parent | next [-]

People who grew up with assembly language or locking primitives are fairly likely to use compare-and-swap because it's literally the commonly understood term for it.

https://en.wikipedia.org/wiki/Compare-and-swap

BenoitP an hour ago | parent | prev [-]

Compare-and-swap is a hardware instruction, and beyond that a desirable pattern for dealing with concurrent writes.

CMPXCHG

https://www.felixcloutier.com/x86/cmpxchg

https://lwn.net/Articles/847973/