[cpp-threads] RE: volatile, memory models, threads
Boehm, Hans
hans.boehm at hp.com
Thu Mar 2 01:43:51 GMT 2006
[Doug wrote:]
> But given the discussions about qualifiers etc, it doesn't
> seem to me that we can revive this proposal. The main problem
> is that we only care about and can give semantics for simple
> scalar types.
> We don't know what to make of the others, and other parts of
> the C and C++ specs don't seem to give us room to do anything
> reasonable.
>
I didn't yet completely arrive at the same conclusion, though you may be
right.
I don't think there's a fundamental problem with having volatile imply
ordering. The issue is what to do with atomicity for objects that don't
have size and/or alignment to support hardware atomicity.
I have assumed that it's reasonable that accesses to only certain scalar
types are atomic for volatile objects. For the rest, volatile implies
ordering/visibility constraints, but not atomicity. That may be
controversial.
I don't know whether we have to address misaligned scalars. I guess
they still exist in standard code with standard ABIs on M68Ks, and maybe
a few other older architectures?
Hans
More information about the cpp-threads
mailing list