This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: catch(...) and forced unwind


On Sat, Dec 13, 2003 at 08:20:15AM -0500, David Abrahams wrote:
> > Basically, all of the C library I/O functions are cancellation points.
> 
> Well, I constider that very surprising. It harms the ability to write
> portable code, for reasons explained below.

No.  If you're writing a threaded program that cancels code, then
I expect that you've *read* POSIX, and thus realize that if you 
want to output bits via write, and you don't want to be canceled,
then you should call pthread_setcancelstate(PTHREAD_CANCEL_DISABLE).

If you havn't done this, then you aren't using the thread API correctly,
and thus are *not* writing portable code.

If you don't want to know about pthread_setcancelstate, then you should
not use pthread_cancel either.  If you never use pthread_cancel, then
none of this thread is even relevant.


r~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]