Interlocked Operations Explained

Interlocked Operations are considered high-performance since they don’t utilize operating system mechanisms to function.  Instead they rely on hardware-based synchronization techniques. Interlocked operations’re a way to update variables in an atomic manner. An operation is considered atomic if it’s indivisible (not in a mathematical sense). During atomic operations threads cannot access variables that’re in use (locked) […]
Interlocked Operations are considered high-performance since they don’t utilize operating system mechanisms to function.  Instead they rely on hardware-based synchronization techniques. Interlocked operations’re a way to update variables in an atomic manner. An operation is considered atomic if it’s indivisible (not in a mathematical sense). During atomic operations threads cannot access variables that’re in use (locked) by a different thread. That having been said, Interlocked Operations are limited in that there’s only so much that the native operations can do. More complex operations would require the use of alternate mechanisms – such as mutexes.