Subj : Re: What is the real costs of LOCK on x86 multiprocesor machine? To : comp.programming.threads From : Mirek Fidler Date : Sat Jul 30 2005 12:18 pm Sean Kelly wrote: > For what it's worth, the IA-32 Developer's Manual has this to say about > LOCK: > > "Beginning with the P6 family processors, when the LOCK prefix is > prefixed to an instruction > and the memory area being accessed is cached internally in the > processor, the LOCK# signal is generally not asserted. Instead, only > the processor's cache is locked. Here, the processor's cache > coherency mechanism insures that the operation is carried out > atomically with regards to memory." > Well, I guess that I should have been be more specific: If accessed memory is contained exclusively in one CPU cache, is it true that LOCK penalty is lower than 100-200 cycles? My question is mostly about reference counted shared objects (e.g. in C++). What I want to find out is whether penalty is present in all cases, or whether when only single thread "owns" shared data (reference count is not accessed by other threads), penalty is lower. Unfortunately, at the moment I do not have hardware to test... Mirek .