[cpp-threads] Somewhat relevant technical report

Nick Maclaren nmm1 at cus.cam.ac.uk
Mon Dec 19 19:47:34 GMT 2005


"Boehm, Hans" <hans.boehm at hp.com> wrote:
> 
> My understanding is that nothing like this has made it into the current
> (draft) standard.

POSIX or C++?  If the former, the politics of whether there will ever
be a new standard beggar description.

> One way to read the technical report is as an argument that what you are
> proposing is in fact substantially different from another interpretation
> of the current standard.  I read the current standard as basically
> guaranteeing that data-race-free programs have sequentially consistent
> semantics, and nothing else.  You want to move to something closer than
> happens-before consistency or the Java model.  The TR argues that there
> may be substantial differences in implementation costs for locks between
> the two, with the Java/happens-before model sometimes being appreciably
> cheaper.  But at the same time, they are not semantically equivalent.

Does anyone have a clear description of what is meant by the terms
data-race-free, sequentially consistent semantics, happens-before
consistency and even the Java model (though I could look that one up)?

Please note that my problem is that I know too many possible meanings,
and am looking for something where I can get a mathematically precise
grip on the way people currently use the terms.

Worse, I am pretty sure that the term sequentially consistent semantics
isn't used to mean what it meant 35 years ago :-(

> I'm inclined to agree with you that your proposal describes what the
> Posix standard eventually should say.  The other interpretation gets you
> little benefit, potentially at significant cost.  I disagree in that I
> think it's a bit of a stretch to argue that it already does say that.
> (However, given the current state of affairs, programmers would clearly
> be well advised to rely only on the weakest possible interpretation,
> especially since that seems to have little practical impact.)

Hang on.  The weakest possible interpretation is "Upon your own head
be it" - or, alternatively "Don't even think of going there".

You don't even need to bring in C to have that problem, because the
wording is such that POSIX does not guarantee that any non-memory
data is synchronised except at program termination.  So you can't
even do I/O from or handle signals in more than one thread.


Regards,
Nick Maclaren,
University of Cambridge Computing Service,
New Museums Site, Pembroke Street, Cambridge CB2 3QH, England.
Email:  nmm1 at cam.ac.uk
Tel.:  +44 1223 334761    Fax:  +44 1223 334679



More information about the cpp-threads mailing list