[cpp-threads] Alternatives to SC (reader cost of SC on JSR133)

Raul Silvera rauls at ca.ibm.com
Thu Feb 1 16:04:25 GMT 2007


cpp-threads-bounces at decadentplace.org.uk wrote on 01/29/2007 07:16:54 PM:

> Hans wrote:
> Based on the JSR133 cookbook rules, I believe that atomic loads can be
> cheap enough.  (You do need an expensive StoreLoad fence between an
> atomic store and a load, and you usually don't have enough context to
> determine whether that's an issue.  But the fence can be associated with
> the store, keeping the load relatively cheap, aside from the "acquire
> fence", which tends not to be that expensive.)  This leaves the issue as
> to whether we can get hardware to guarantee that the JSR133 rules
> actually guarantee SC, or only something weaker, which is being
> discussed.
>

To achieve SC, you need a StoreLoad fence not just between an atomic store
and a load, but also between atomic loads. Otherwise the IRIW case fails.
Doug, do you agree with that?

This would mean that each load requires a StoreLoad fence, which is an
unacceptable burden, specially since it is implementing semantics that are
rarely (if ever) needed. Can anyone cite examples of real-world programs
that depend on IRIW for correctness?





More information about the cpp-threads mailing list