I am reading an article on algorithms for parallel computing and came across the following sentence.  What do they mean by a swap-with-memory instruction?Our algorithm provides reasonable latency in the absence of contention, requires only a constant amount of space per lock, and requires no hardware support other than a swap-with-memory instruction.J. M. Mellor-Crummey and M. L. Scott, Algorithms for Scalable Synchronization on Shared-Memory Multiprocessors. ACM Transactions on Computer Systems, 9(1):21–65, 1991. (PDF)
What is a swap-with-memory instruction?
parallel computing;memory hardware
A swap-with-memory instruction swaps a register's value with that of a memory location.  An example of such an instruction would be the Intel 8086 XCHG instruction which can swap a register value with memory or swap two register values.  Another example would be the indirect modes of the Zilog Z80 EX instruction, which swapped register values with memory locations at the top of the stack.