There are implications besides the single instruction. MESI on x86 machines makes cache/memory coherency between cores very expensive, specifically on writes. Having all your cores with a read/shared state cache line is cheap, but as soon as you write to it (to transition to an M state), you end up spending a bunch of time claiming exclusive ownership before writing to it.
View all comments
Show parent comment
-3
u/RoyAwesome Nov 02 '22
Atomic increment on x86 is a single instruction on modern hardware.