3 ms·
Yes, it is implemented by the hardware. In x86 I believe it is the CMPXCHG assembler instruction. GCC, for example has __sync_val_compare_and_swap(...) functio
by rdtsc 17y ago
Yes, it is implemented by the hardware. In x86 I believe it is the CMPXCHG assembler instruction.
GCC, for example has __sync_val_compare_and_swap(...) function that give you access to the hardware compare and swap.