[cpp-threads] Does pthread_mutex_lock() have release emantics?

Boehm, Hans hans.boehm at hp.com
Fri May 6 23:03:31 BST 2005


We may end up effectively using the Java definition of races.
There is no point in using anything beyond that, since
race-free programs exhibit sequential consistency.  In Java
that's a theorem.  For us, that can just be the definition.

The definition in the current draft has the advantages that:

a) It's much simpler since we don't need to explicitly define
the "happens-before" relation.  (It's also quite possibly too
simple once we add atomic operations.  But a really simple rule
for the majority of programmers who will hopefully only use
locks would be nice.)
b) It's more obviously consistent with the pthreads approach.

Hans

> -----Original Message-----
> From: 
> Cpp-threads_decadentplace.org.uk-bounces at decadentplace.org.uk 
> [mailto:Cpp-threads_decadentplace.org.uk-bounces at decadentplace
> .org.uk] On Behalf Of Peter Dimov
> Sent: Friday, May 06, 2005 2:29 PM
> To: cpp-threads at decadentplace.org.uk; Alexander Terekhov
> Subject: Re: [cpp-threads] Does pthread_mutex_lock() have 
> release emantics?
> 
> 
> Alexander Terekhov wrote:
> > On 5/6/05, Peter Dimov <pdimov at mmltd.net> wrote:
> >
> > [... perverse DCSI ...]
> >
> >> Can someone please explain what do we gain by not using 
> the JMM as is 
> >> (with data races left undefined)?
> >
> > Try
> >
> > 
> http://groups.google.de/group/comp.programming.threads/msg/63fec0c2b97
> > c76ec
> >
> > ;-)
> 
> I don't get it. :-) 
> 
> 
> -- 
> cpp-threads mailing list
> cpp-threads at decadentplace.org.uk 
> http://decadentplace.org.uk/mailman/listinfo/cpp-threads_decad
entplace.org.uk




More information about the cpp-threads mailing list