[cpp-threads] SC on PPC
Alexander Terekhov
alexander.terekhov at gmail.com
Tue May 1 10:40:32 BST 2007
On 5/1/07, Raul Silvera <rauls at ca.ibm.com> wrote:
> Alexander wrote on 04/30/2007 03:59:26 PM:
>
> > On 4/30/07, Raul Silvera <rauls at ca.ibm.com> wrote:
> > [...]
> > > ord_load: sync;load;sync
> >
> > sync;lr-sc loop;isync
>
> I think you'll agree that a hwsync is better than a lr-sc
> loop in terms of performance (no false sharing). Hopefully
> my other note convinced you it is functionally sufficient.
I'm still unconvinced.
>
> > > ord_store: lwsync;store;sync
> >
> > Agreed.
> >
> > > acq_load: load;lwsync
> >
> > load;"branch never taken";isync
>
> This depends on how you define acquire, but if it is defined to
> enforce causality it is insufficient. In particular, it wouldn't
> support this case:
>
> P1: x=1
> P2: if (x.load_acquire()==1) { y.store_relaxed(1) }
> P3: if (y.load_acquire()==1) { Assert(x.load_relaxed()==1) }
Well, consider that on Itanium
P1: x.store_relaxed(1)
P2: if (x.load_acquire()==1) { y.store_relaxed(1) }
P3: if (y.load_acquire()==1) { Assert(x.load_relaxed()==1) }
may well abort.
I'd define *acquire* no stronger than Itanium and wouldn't impose
remote write atomicity for release (relax release in this respect).
regards,
alexander.
More information about the cpp-threads
mailing list