 Such locking is important when it is used to implement thread-safe synchronization, as in mutexes.However, an "XCHG" is usually the fastest way to swap two machine-size words residing in registers.Register renaming may also be used to swap registers efficiently.