You can get an atomic operation with a 64-bit value using InterlockedExchange64 on 64-bit platforms and in Windows Vista / 7. This would be enough to match the two 32-bit int values ββin the structure.
Since the function is implemented using the built-in integrator, it basically invokes a platform-specific assembly, such as x86 CMPXCHG . Since this command only works with the maximum (on 64-bit platforms) in a 64-bit register source operand, a 64-bit register or memory assignment operand, and in the RAX register, there is only a certain value that you can perform an atomic operation using separate instructions assembly without including any type of lock or semaphore to create a critical partition.
Jason source share