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:

    We are told that men protect us; that they are generous, even chivalric in their protection. Gentlemen, if your protectors were women, and they took all your property and your children, and paid you half as much for your work, though as well or better done than your own, would you think much of the chivalry which permitted you to sit in street-cars and picked up your pocket- handkerchief?
    Mary B. Clay, U.S. suffragist. As quoted in History of Woman Suffrage, vol. 4, ch. 3, by Susan B. Anthony and Ida Husted Harper (1902)

    The history of work has been, in part, the history of the worker’s body. Production depended on what the body could accomplish with strength and skill. Techniques that improve output have been driven by a general desire to decrease the pain of labor as well as by employers’ intentions to escape dependency upon that knowledge which only the sentient laboring body could provide.
    Shoshana Zuboff (b. 1951)