Subj : Re: What is the real costs of LOCK on x86 multiprocesor machine? To : comp.programming.threads From : Joe Seigh Date : Sun Jul 31 2005 10:39 am chris noonan wrote: > Joe Seigh wrote: >> >>Statically or dynamically linked code? The only case I >>think you can safely get away with making LOCK optional >>is in system dynamically linked libraries that are hardware >>configuration specific. I use LOCK in inlined code since it's >>in effect statically linked and you don't know where the code >>will eventually execute. > > > The LOCK prefixes are always in the source code, > unconditionally. So the software ships with LOCK in > the binaries. The software installer determines > whether the machine is uniprocessor or multiprocessor. > If the former, it alters the binary file accordingly, > overwriting the LOCK prefixes with NOP, working from > a list of offsets that is potentially different for > each compilation. > > Is that what you were asking? > Static libraries vs. dynamic ones. You have no control over where staticly linked code will execute so you should assume the most general case. Self modifying code is not always an option. -- Joe Seigh When you get lemons, you make lemonade. When you get hardware, you make software. .