Is it true that the x86 ASM "LOCK" command prefix causes all cores to freeze while the instruction following "LOCK" is being executed?
I read this in a blog post and it doesn't make sense. I can't find anything that indicates if this is true or not.
It's about locking the memory bus for that address. The Intel 64 and IA-32 Architectures Software Developer's Manual - Volume 3A: System Programming Guide, Part 1 tells us:
Here we learn that the P6 and newer chips are smart enough to determine if they really have to block off the bus or can just rely on intelligent caching. I think this is a neat optimization.
I discussed this more in my blog post "How Do Locks Lock?"
No, but it may force other processors to wait while this one accesses memory. Whether these wait states ever make a difference depend on the extent to which the processors are running off a cache.