Subj : Re: Memory visibility and MS Interlocked instructions To : comp.programming.threads From : Peter Dimov Date : Thu Aug 25 2005 02:01 pm Alexander Terekhov wrote: > BOOL FetchComputedValue(int *piResult) > { > if (fValueHasBeenComputed.load(msync::cchlb_true)) > { > *piResult = iValue.load(msync::naked_competing); > return TRUE; > } > else > return FALSE; > } > > To Peter: I've extended cc* stuff with path specific variants so > that you can give compiler a hint on which path you don't really > need isync. Almost missed it. Can you give approximate PPC translation for the expression fValueHasBeenComputed.load(msync::cchlb_true) assuming that the compiler is not smart/atomics-aware and can't just insert the isync after the 'if'? (IOW, it can't analyze and optimize the 'load' in context... a library implementation, for example.) .