[cpp-threads] Whence Sequential Consistency?
Jeremy Manson
jmanson at cs.umd.edu
Fri Jan 19 22:43:03 GMT 2007
Lawrence Crowl wrote:
> Jeremy Manson <jmanson at cs.umd.edu> writes:
>> So, in short, all you have to do is make sure that your conflicting
>> accesses are ordered by happens-before, and you get sequential
>> consistency as a guarantee of the program. It is unnecessary to
>> guarantee that individual program instructions (like CAS) provide
>> sequential consistency: only that they provide happens-before.
>
> So why are we worried about whether or not the atomic operations
> are sequentially consistent? Shouldn't the discussion be "can
> these primitives be used to build sequentially consistent programs"?
You have hit a very, very important point right on the head. We have
hypothesized in Java about whether it is important for volatiles to be
sequentially consistent. We have tried to come up with non-contrived
examples where it matters, but have not been terribly successful.
The point that comes up repeatedly is that sequential consistency is
easier to explain than IRIW / CCCC, because the explanation is one
sentence. This is a nice property. But no one seems to be able to come
up with a convincing pattern where it is actually more useful for code
in practice. So if it comes down to "easy to explain" versus
"practical", we will probably have to go with "practical".
Jeremy
More information about the cpp-threads
mailing list