x86 equivalent for LWARX and STWCX

前端 未结 6 1662
天命终不由人
天命终不由人 2020-12-17 22:07

I\'m looking for an equivalent of LWARX and STWCX (as found on the PowerPC processors) or a way to implement similar functionality on the x86 platform. Also, where would be

6条回答
  •  悲哀的现实
    2020-12-17 22:27

    x86 does not directly support "optimistic concurrency" like PPC does -- rather, x86's support for concurrency is based on a "lock prefix", see here. (Some so-called "atomic" instructions such as XCHG actually get their atomicity by intrinsically asserting the LOCK prefix, whether the assembly code programmer has actually coded it or not). It's not exactly "bomb-proof", to put it diplomatically (indeed, it's rather accident-prone, I would say;-).

提交回复
热议问题