Topic: Threads and Exceptions


Author: <db@engnews2.Eng.Sun.COM>
Date: 1995/10/13
Raw View
rbarris@netcom.com (Robert Barris) wrote:
>I have a question about threads and C++ exceptions.
>
>Is it expected that a C++ compiler environment should provide a mechanism for
>ensuring that exception handling can be done safely in a multi-threaded
>program?

I'm not alone in _expecting_ that out of a reasonable compiler!  And
in fact, it's known to be possible.  I work with compilers every day
which do that.

However, it's true that this is a bit beyond scope of the current C++
standards work ... just as for example the POSIX threading standard does
not address a C++ binding for POSIX Threads.

Some questions to think about:  when threads are canceled, how do they
clean up?  What's the interaction of C and C++ cleanup mechanisms?  And
what good would the POSIX "asynchronous cancellation" mode be to a C++
program?
--
David Brownell                        db@Eng.Sun.COM.
Enterprise Distributed Objects

main(a){printf(a,34,a="main(a){printf(a,34,a=%c%s%c,34);}",34);}
---
[ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy
  is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]