[cpp-threads] Alternatives to SC

Jeremy Manson jmanson at cs.umd.edu
Sun Jan 14 00:54:49 GMT 2007


Doug Lea wrote:
> 
> Thanks for questions! Here are some pointwise clarifications:
> 
> Paul E. McKenney wrote:

>>> G = (S,-->) is a set of nodes S and a binary (directed) relation --> on
>>>    the nodes. Nodes are of type:
>>>      e ranges over read and write events,
>>>      r over read events and
>>>      w over write events.
>>
>> So an atomic RMW event would carry all three types, right?
> 
> Yes. As a first approximation, CAS can be modeled as a read followed
> by a write. The model can be made more precise about effects by
> explicitly adding it as an event though.
> 

Wouldn't a CAS being modeled this way give up atomicity?  i.e.,

Thread 1

CAS 0, x, 1

Thread 2:

CAS 0, x, 2

If these were modeled:

r1 = x;
if (r1 == 0)
   x = <value>;


Then you lose the intended CAS semantics.  Or is that what you meant by 
being "made more precise about effects"?

					Jeremy



More information about the cpp-threads mailing list