[cpp-threads] SC on PPC

Hans Boehm Hans.Boehm at hp.com
Wed May 2 16:06:12 BST 2007



On Wed, 2 May 2007, Alexander Terekhov wrote:

>
> I'm talking about the cost of acquire on PPC.
>
> P1: x.store_relaxed(1)
> P2: if (x.load_relaxed()==1) { y.store_release(1) }
> P3: if (y.load_acquire()==1) { Assert(x.load_relaxed()==1) }
>
> wont abort with
>
> load_acquire:   load;"branch never taken";isync // see B.2.3 Safe
> Fetch (Book II).
> store_release:  lwsync;store
>
> I don't want to have more constrained
>
> load_acquire:   load;lwsync
>
Certainly that's an interesting question.  On the other hand, I'm saying
that in the proposed C++ memory model, this is allowed to abort unless you
change the initial store_relaxed to a store_release.

I susoect this has little bearing on the rest of your discussion, though.
And I can't think of realistic situations in which you wouldn't need the
store_release in P1 anyway.

Hans



More information about the cpp-threads mailing list