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

Jean-Marc Bourguet jm at bourguet.org
Mon Dec 22 15:34:52 UTC 2003


Fergus Henderson wrote:
> On 22-Dec-2003, Jean-Marc Bourguet <jm at bourguet.org> 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?
> 
>  and interoperatibility with
> I think part of the difficulty is that the problem may be over-constrained.
> Ideally, the solution would
> 
> 	- not require changes to the C pthread library
> 	- not modify the C interface visible from C
> 	- not modify the C interface visible from C++
> 	- never result in a thread cancellation request being ignored
> 	- allow threads to execute arbitrary cleanup code in
> 	  response to a thread cancellation request
> 	- make exception-safe C++ code also safe for (synchronous)
> 	  cancellation
> 	- make cancellation-safe C code also exception-safe,
> 	  and allow propagation of C++ exceptions through cancellation-safe
> 	  C code
> 	- not introduce any new C++ language constructs or semantics
> 	- not introduce any new C language constructs or semantics
> 	- not reduce performance of any existing code
> 	- be simple, easy to use/understand/teach/specifiy/implement, etc.
> 	- probably some other goals that I've accidentally omitted/forgotten
> 
> However, it is almost certainly not possible to achieve all of these
> simultaneously.

I know, but allowing to redesigning Posix, C and C++ is probably a
under-constrained problem.  Agreeing on constraints and goals and prioritize
them is probably important to get a usefull solution.

-- 
Jean-Marc




More information about the c++-pthreads mailing list