[cpp-threads] pthreads (was: RE: C++ Connections proposal)

Peter Dimov pdimov at mmltd.net
Tue Apr 26 18:36:35 BST 2005


Doug Lea wrote:
> Rather than bicker among themselves :-), could the new members
> arguing for the "pthreads can be saved" position write a simple
> non-XDB-jargon-filled summary of roughly how they propose to do this
> within the scope of the C++ standard? I'm lost.

I think that you mean the pthreads memory model.

I'm not arguing that the pthreads memory model can be saved (but Alexander 
may be). I personally have no need for the stricter sequentally consistent 
semantics that make the example

    if (x == 1) ++y;

    if (y == 1) ++x;

well-defined (IIUC), but I'm not qualified to propose a more relaxed memory 
model.

I am more interested in the library part of the threading iceberg. If my 
understanding is correct, the sequentally consistent model makes all 
"correct" pthreads programs well-defined as a side effect, so <pthread.h> 
(or <cpthread>) becomes a viable alternative for C++ programmers. So in 
effect pthreads the library interface _is_ being saved by the proposed 
memory model. 





More information about the cpp-threads mailing list