[cpp-threads] Counter strawman proposal :-)
Peter Dimov
pdimov at mmltd.net
Sun Jun 12 14:49:22 BST 2005
A modification M of a scalar object is _potentially visible_ to an attempt A
to access the stored value of that object if:
- the modification is not _shadowed by_ another modification, and
- the modification does not _occur after_ the access.
If no modifications are _potentially visible_ at the point where the value
is accessed, the behavior is undefined.
If two or more modifications that yield distinct values are _potentially
visible_, the accessed value is unspecified. Note that the accessed value is
not guaranteed to match any of the potentially visible values.
A modification M is _shadowed by_ another modification M2 if:
- M2 _occurs after_ M, and
- A _occurs after_ M2.
An operation O1 _occurs after_ an operation O2 if:
- the two operations are done by the same thread and there exists a sequence
point between O2 and O1, or
- O1 _synchronizes with_ O2, or
- there _exists an ordering constraint between_ O2 and O1.
There _exists an ordering constraint between_ O1 and O2 when:
- a sink-(O1 type) barrier _occurs after_ O1 in its thread, and
- a hoist-(O2 type) barrier _occurs before_ O2 in its thread, and
- the first barrier precedes the second barrier in the program execution.
--
Peter Dimov
http://www.pdimov.com
More information about the cpp-threads
mailing list