[cpp-threads] Web site updated

Peter Dimov pdimov at mmltd.net
Tue Feb 13 20:22:52 GMT 2007


Boehm, Hans wrote:
>> MMIO accesses, anyone?  Hardware timing analysis (especially
>> if there is a short loop between the two)?
>>
>> Let's please just outlaw that sort of optimization for
>> store_raw(), so that it can retain its full meaning.
>>
> My understanding is that we are constrained here as to what we can
> require in normative standards text.

Even if we aren't so constrained, do we really want to forbid these 
optimizations?

atomic_fetchadd_relaxed( &cnt, +1 );

// ordinary ops 1

atomic_fetchadd_relaxed( &cnt, +1 );

// ordinary ops 2

atomic_fetchadd_relaxed( &cnt, +1 );

I'd really like the MM to be enlightened/permissive enough as to allow

// ordinary ops 1+2

atomic_fetchadd_relaxed( &cnt, +3 );

here. (This should work even for _release because moving in one direction is 
still allowed; not for the various flavors of _ordered, though.)

Similarly,

atomic_fetchadd_relaxed( &cnt, r );
atomic_fetchadd_relaxed( &cnt, -r );

should be a noop, even for _ordered.

> I am less clear as to what we can reasonably suggest as nonbinding
> notes in the standard.

We are free to suggest pretty much anything in notes, examples and 
footnotes, as long as it doesn't contradict the normative text.




More information about the cpp-threads mailing list