Subj : Re: What is the real costs of LOCK on x86 multiprocesor machine? To : comp.programming.threads From : Chris Thomasson Date : Fri Jul 29 2005 03:31 pm >> Surprisingly, on Intel Pentium processors the overhead of >> a locked instruction is about the same for a single processor >> as for one in a multiple processor configuration. > > Hm, can you give me some numbers? Is it closer to my measurement (3 times > slower than non-atomic) or to 100 cycles I have seen somewhere? There are too many variables to consider for any definitive answers. For example, the negative effects of asserting a cpu's #LOCK signal could be tremendous. It also tends to have different timing results on multi-cpu systems because the #LOCK signal actually locks the entire system bus so subsequent requests from any other cpu's are blocked. You can't really know how many operations were blocked during a #LOCK signal assertion. Sometimes the #LOCK signal assertion can be avoided if the shared data being accessed is already cached in the cpu. This variable behavior can lead to inconsistent timing results. -- http://appcore.home.comcast.net/ (portable lock-free data-structures) .