[cpp-threads] out-of-thin-air results, depndency-based orderingagain.

Peter Dimov pdimov at mmltd.net
Fri Feb 16 14:16:56 GMT 2007


Doug Lea wrote:
> Have you considered the following alternate plan of attack?
>
> The underlying desire seems to be that load_relaxed
> be implemented exactly as load_acquire except that there
> is no machine-level fence issued. Perhaps a better name
> for this would be "load_speculative" since the effects
> rely on the state of coherence mechanics etc, which might
> be thought of as a random process -- sometimes
> you will see the most current value, sometimes not.

This is not entirely true for the usual meaning of "speculative execution"; 
it refers to executing an instruction before its time has come. Both 
load_relaxed and load_acquire can be speculatively executed before the 
instructions that precede them, but load_acquire can't be executed after the 
instructions that follow it. So load_relaxed is allowed to be delayed more 
and as a result, it can see a "more current" value than load_acquire, if my 
understanding is correct. :-) 




More information about the cpp-threads mailing list