Compare-and-swap - History of Use

History of Use

Compare-and-Swap (and Compare-and-Swap-Double) has been an integral part of the IBM 370 (and all successor) architectures since 1970. The operating systems which run on these architectures make extensive use of this instruction to facilitate process (i.e., system and user tasks) and processor (i.e., central processors) parallelism while eliminating, to the greatest degree possible, the "disabled spin locks" which had been employed in earlier IBM operating systems. Similarly, the use of Test-and-Set was also eliminated. In these operating systems, new units of work may be instantiated "globally", into the Global Service Priority List, or "locally", into the Local Service Priority List, by the execution of a single Compare-and-Swap instruction. This substantially improved the responsiveness of these operating systems.

In the x86 and Itanium architectures this is the compare and exchange (CMPXCHG) instruction, though here the lock prefix should be there to make it really atomic.

Read more about this topic:  Compare-and-swap

Famous quotes containing the words history of and/or history:

    “The whole history of civilisation is strewn with creeds and institutions which were invaluable at first, and deadly afterwards.”
    —Walter Bagehot (1826–1877)

    “History does nothing; it does not possess immense riches, it does not fight battles. It is men, real, living, who do all this.... It is not “history” which uses men as a means of achieving—as if it were an individual person—its own ends. History is nothing but the activity of men in pursuit of their ends.”
    —Karl Marx (1818–1883)