Subj : Re: CMPXCHG timing To : comp.programming.threads From : Michael Pryhodko Date : Fri Apr 01 2005 06:32 am > The redundant store isn't observable. cmpxchg is atomic. If there's > a problem, it's with your code elsewhere. I'm not quite sure what > you are trying to do, so I don't know where to look or what suggestions > to make. Hmmm... try to run this small test app, you'll that: - cmpxchg (without LOCK prefix) is not atomic (it is impossible to do read+write operation atomic on x86 without using bus LOCK) - this stupid redundant store is quite observable, and basically it prevent my LOCK'less lock from working! It makes 'unlock' operation impossible to implement or on other hand I did a VERY stupid mistake... About what I am trying to do -- see my answer to another posting. Bye. Sincerely yours, Michael. .