By: Eric Bron nli (email@example.com), December 5, 2014 1:28 am
Room: Moderated Discussions
>For an unspecified x86 processor:
MemoryBarrier was measured as taking 20-90 cycles.
> InterlockedIncrement was measured as taking 36-90 cycles.
> Acquiring or releasing a critical section was measured as taking 40-100 cycles.
so using a CriticalSection is generally a better choice than using ASM with lock prefixes, higher level, more flexible, and even faster/lower power when heavy contention (thanks to the PAUSE instruction)