[cpp-threads] SC on PPC

Raul Silvera rauls at ca.ibm.com
Tue May 1 01:34:16 BST 2007


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.

> > 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) }

The issue is that isyncs do not trigger cumulativity.

> B.2.3 Safe Fetch (Book II).
>
> > rel_store:  lwsync;store
>
> Agreed.
>
> regards,
> alexander.
>

--
Raúl E. Silvera         IBM Toronto Lab   Team Lead, Toronto Portable
Optimizer (TPO)
Tel: 905-413-4188 T/L: 969-4188           Fax: 905-413-4854
D2/KC9/8200/MKM




More information about the cpp-threads mailing list