[cpp-threads] memory model

Kevlin Henney kevlin at curbralan.com
Mon Apr 25 11:10:20 BST 2005


In message <Pine.GHP.4.58.0504231258260.20092 at tomil.hpl.hp.com>, Hans
Boehm <Hans.Boehm at hp.com> writes
>I put a very rough draft describing my impression of the current state of
>the memory model proposal at
>
>http://www.hpl.hp.com/personal/Hans_Boehm/c++mm/mm.html
>
>Comment/corrections/disagreements are welcome.  I'd like to use this to
>also track issues that we still needto resolve.

I just wanted to clarify what your exact concerns were with sequence
points:

"[Things get complicated here due to the indeterminate argument
evaluation order in the language. Based on my reading of the standard,
we may need to clean up the it up a bit here. "Sequence points" don't
seem quite sufficient to express that in f((a, b), c), b must be
evaluated after a, but is unordered with respect to the evaluation of c,
which I think is the intent. This matters for us, since a may acquire a
lock. It also matters to sequential semantics.]"

My reading of the standard is that we are guaranteed a is evaluated
before b, but that the ordering between c and a or c and b is not
guaranteed, ie the following are permissible sequences:

        <c, a, b>
        <a, c, b>
        <a, b, c>

Thus any lock acquired by a can be guaranteed applicable to b, but not
to c, and any lock acquired by c cannot be guaranteed applicable to
either a or b.

Kevlin
-- 
____________________________________________________________

  Kevlin Henney                   phone:  +44 117 942 2990
  mailto:kevlin at curbralan.com     mobile: +44 7801 073 508
  http://www.curbralan.com        fax:    +44 870 052 2289
  Curbralan: Consultancy + Training + Development + Review
____________________________________________________________




More information about the cpp-threads mailing list