2 ms·
Operating systems where you need to be able to atomically insert or remove from a list. Because the links are just pointers and the memory can be managed after
by leeter 4y ago
Operating systems where you need to be able to atomically insert or remove from a list. Because the links are just pointers and the memory can be managed after the swap you can use atomics to compare and swap pointers. This allows for the RCW mechanisms the linux and NT kernels depend on to work.
This also technically applies to lockless data structures for some high performance code too. But those tend to be much much more tightly tuned for performance and the specific CPU they are intended to run on.