[c++-pthreads] C++ and posix threads

Mark Mitchell mark at codesourcery.com
Mon Dec 22 16:48:26 UTC 2003


On Mon, 2003-12-22 at 06:52, Jean-Marc Bourguet wrote:
> I feel confused.  I wonder what is the context of the discussion
> and especially the constraints or the liberties we assume from
> an implementation.  Shoult it
>     - need the collaboration of the pthread library or be implementable
>       as wrapper around an existing pthread library?
>     - allow modifications to the C interface visible from C or not?
>     - allow modifications to the C interface visible from C++ or not?

These are excellent questions.

I believe that the right answers are that:

(a) it is OK to have to make modifications to the pthread and/or C
libraries on the system,

(b) the modifications must be backwards-compatible in C (i.e., no
functions should be removed from the pthreads library, although it would
be OK to add new ones), and

(c) it is OK to consider slightly broader modifications to the existing
C interfaces for C++ (such as modifying "read()" to throw an exception),
but it should still be possible to recompile C programs as C++ programs
and get reasonable behavior.

-- 
Mark Mitchell <mark at codesourcery.com>
CodeSourcery, LLC




More information about the c++-pthreads mailing list