[cpp-threads] C++ memory model

N.M. Maclaren nmm1 at cam.ac.uk
Wed Sep 23 07:56:56 BST 2009


On Sep 22 2009, Boehm, Hans wrote:
>> 
>> The sentence is redundant and can be turned into a note if 
>> the previous
>> sentence:
>> 
>> "Implementations should make atomic stores visible to atomic 
>> loads within a reasonable amount of time."
>> 
>> is made to use "shall" instead of "should". 
>
> I think that to make this precise, we'd probably have to talk about 
> fairness. And there are probably good reasons not to do that, in that 
> it's not clear we want to disallow non-preemptive schedulers.

Yes.  I have never heard of anyone getting anywehere with this, except
by defining specific models.  The killer is the same one as for sequential
consistency - it's the requirement for global sanity that is hard to
specify, and purely local sanity isn't enough.

In particular, it wouldn't be useful if it didn't address the problem of
implementation-inserted livelock.  I.e. where, in a mathematically fair
system, a program would progress - but, in the actual implementation, it
doesn't.  I have been caught by that one just too often, typically when a
correct, 'portable' program doesn't work on a new system or requires some
particular configuration parameters.

And how to address that one is an unsolved problem :-(

Regards,
Nick Maclaren.









More information about the cpp-threads mailing list