[cpp-threads] Another strawman memory model proposal

Peter Dimov pdimov at mmltd.net
Sun May 8 19:52:55 BST 2005


Peter Dimov wrote:
> Peter Dimov wrote:
>> - There is a sequence point between unlock on a mutex and a
>> subsequent lock on the same mutex.
>>
>> - 1.9/8 does not apply to functions that are executed in a separate
>> thread. There is no sequence point between the end of such function
>> and the evaluation of expressions outside this function.
>>
>> - There is a sequence point between the end of a function executed in
>> a separate thread and a join action or a successful try_join action
>> on that thread.
>
> - A scalar object can be modified more than once without an
> intervening sequence point if all modifications are atomic.
>
> - The value of a scalar object that is modified between two sequence
> points can be accessed more than once and for any purpose if the
> modifications and the accesses are atomic.

And now, for fans of sequential consistency:

... Such accesses return the value of the object after the immediately 
preceding

* sequence point, or
* atomic modification.

For the rest of us:

... Such accesses return one of:

* the value of the object at the preceding sequence point;
* the value of the object after an atomic modification has been performed on 
it between the two sequence points.

Which of these values is returned is unspecified.

>> - There is a sequence point immediately before an atomic operation
>> with release semantics.
>>
>> - There is a sequence point immediately after an atomic operation
>> with acquire semantics. 





More information about the cpp-threads mailing list