Subj : Re: CAS question To : comp.programming.threads From : Joe Seigh Date : Fri Mar 25 2005 06:52 pm On Fri, 25 Mar 2005 22:30:34 -0000, Toby Douglass wrote: > jseigh_01@xemaps.com wrote: > >> The argument expressions are evaluated before the function is called. They >> don't have to be atomic or anything. > > Is this true in all cases, though? I don't know x86, but I could > imagine that something simple like an addition or subtraction could be > performed in situ on an operand to the atomic instruction. In a > hardware sense, it would just be a case of getting a ALU to perform an > operation on an operand as it passes down the pipeline, which seems > reasonable. > The api in question here is in C and that's how C works. The implementation does whatever it needs to do. -- Joe Seigh .