Alignment requirements for atomic x86 instructions vs. MS's InterlockedCompareExchange documentation?

前端 未结 4 1961
灰色年华
灰色年华 2020-11-28 07:06

Microsoft offers the InterlockedCompareExchange function for performing atomic compare-and-swap operations. There is also an _InterlockedCompareExchange intrinsic.<

4条回答
  •  攒了一身酷
    2020-11-28 07:36

    Microsoft's Interlocked APIs also applied to ia64 (while it still existed). There was no lock prefix on ia64, only the cmpxchg.acq and cmpxchg.rel instructions (or fetchadd and other similar beasties), and these all required alignment if I recall correctly.

提交回复
热议问题