Subj : Re: YALFAm (Yet Another Lock Free Approach, maybe) To : comp.programming.threads From : David Butenhof Date : Thu May 19 2005 01:08 pm Chris Thomasson wrote: >>Even with the _InterlockedCompareExchange() intrinsic function on Windows? > > Well, I am "not totally sure" of Microsoft's specific guarantees wrt > implementing sensitive multi-threaded algorithms. It might be safe... > > Yet again, it might not be so safe after all... Gee, Chris. I have this odd feeling of deja vu. Haven't we, uh, been here before? ;-) The problem with all this is that Microsoft code and documentation was written for a really primitive in-order X86 architecture. The code has been adapted somewhat randomly along the way, documentation has not been updated to reflect DESIGN INTENT, and in fact it's by no means clear that there really IS any design intent. So you can experiment and bet your code that they INTEND it to do what you currently observe, and risk that they'll change it, and that future adaptations will remain true to your assumption... or you can play a little safer and go by the most loose interpretation of what they actually SAY. Or you can be paranoid and assume they'll probably screw it up in the future for their own reasons (or for no reason at all), and not trust it as far as it could throw you... -- Dave Butenhof, David.Butenhof@hp.com HP Utility Pricing software, POSIX thread consultant Manageability Solutions Lab (MSL), Hewlett-Packard Company 110 Spit Brook Road, ZK2/3-Q18, Nashua, NH 03062 .