Which CPU architectures support Compare And Swap (CAS)?

前端 未结 10 1821
野性不改
野性不改 2020-12-12 15:53

just curious to know which CPU architectures support compare and swap atomic primitives?

10条回答
  •  情深已故
    2020-12-12 16:30

    Sparc v9 has a cas instruction. The SPARC v9 architecture manual discusses the use of the CAS instruction in Annex J, look specifically at examples J.11 and J.12.

    I believe the name of the instruction is actually "casa", because it can access either the current address space or an alternate. "cas" is an assembler macro which accesses the current ASI.

    There is also an article on developers.sun.com discussing the various atomic instructions which Sparc processors have implemented over the years, including cas.

提交回复
热议问题