[cpp-threads] Somewhat relevant technical report

Boehm, Hans hans.boehm at hp.com
Mon Dec 19 19:17:15 GMT 2005


Alexander -

My understanding is that nothing like this has made it into the current
(draft) standard.

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.

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.)

Hans

> -----Original Message-----
> From: cpp-threads-bounces at decadentplace.org.uk 
> [mailto:cpp-threads-bounces at decadentplace.org.uk] On Behalf 
> Of Alexander Terekhov
> Sent: Monday, December 19, 2005 12:31 AM
> To: C++ threads standardisation
> Subject: Re: [cpp-threads] Somewhat relevant technical report
> 
> 
> On 12/18/05, Hans Boehm <Hans.Boehm at hp.com> wrote:
> > Where does the standard say that such locks can be removed?
> >
> > It states that pthread_mutex_lock() synchronizes memory unless it 
> > fails.
> 
> The standard doesn't define the term "synchronize memory". 
> The entire point of
> 
> http://www.opengroup.org/austin/mailarchives/ag-review/msg01875.html
> 
> (and subsequent DRs) was to get id of *not defined* term 
> "memory synchronization".
> 
> http://www.opengroup.org/austin/mailarchives/ag/msg07649.html
> http://www.opengroup.org/austin/mailarchives/ag/msg07651.html
> http://www.opengroup.org/austin/mailarchives/ag/msg07653.html
> 
> regards,
> alexander.
> 
> -- 
> cpp-threads mailing list
> cpp-threads at decadentplace.org.uk 
> http://www.decadentplace.org.uk/cgi-bin/mailman/listinfo/cpp-threads
> 



More information about the cpp-threads mailing list