Custom Atomics with atomicCAS
Compare-and-swap for any update.
When Built-Ins Run Out
The built-in atomics cover add, max, exchange and more. But what if you need an atomic update they do not provide? Meet atomicCAS. 🔁
Compare-And-Swap
atomicCAS means compare-and-swap. It writes a new value only if the current value matches what you expected, all in one atomic step.
atomicCAS(addr, expected, desired);All lessons in this course
- Race Conditions on the GPU
- atomicAdd and Friends
- Building a Histogram
- Custom Atomics with atomicCAS