Subj : Re: sync vs. eieio on powerpc To : comp.programming.threads From : Alexander Terekhov Date : Tue Mar 01 2005 03:15 pm Joe Seigh wrote: > > On Tue, 01 Mar 2005 14:37:09 +0100, Alexander Terekhov wrote: > > > > > Joe Seigh wrote: > > [...] > >> > Nope. You can have ordinary loads in between LR and SC+isync. They > >> > are unordered (data and control dependencies aside for a moment). And > >> > think of moving isync above SC (which is a store, not a load). > >> > > >> > >> That's what I said. > > > > No. SC+isync != isync+SC, so to speak. > > > > isync is not a store/store when used with store conditional, e.g. > if one thread does > > stwcx > isync > stw In order to have msync effect, isync needs preceding conditional branch. In the case of lock acquisition, that conditional branch is related to store, not load. So it IS store/* thing. [...] > It is a really bad idea to define isync as an "acquire" barrier > even though it may appear to work as one in certain situations. I agree. They should have provided straightforward SC with a whole bunch of associated combinations (if any) of unidirectional hoist and sink constraints affecting (only in the case of successful SC of course) subsequent and/or preceding (in the program order) loads and/or stores respectively. regards, alexander. .