Re: [c++-pthreads] Re: FW: RE: Re: I'm Lost
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [c++-pthreads] Re: FW: RE: Re: I'm Lost



The C++ language can be extended to cope with the concept of async-
cancel safety. I can even imagine that async cancel can be made the
default with compiler automatically inserting sync_cancel { }
wrappers (resulting in extra map tables entries with no runtime
penalty until attempting async cancel delivery and finding out that
it wasn't expected) for any async-cancel unsafe expressions. I see
no reason why tons of std lib stuff like strlen() can't be declared
to be

size_t strlen(const char *s) async_cancel_safe;

regards,
alexander.


"Peter Dimov" <pdimov@xxxxxxxxx> on 08.03.2006 22:44:45

To:    "Dave Butenhof" <david.butenhof@xxxxxx>, "David Abrahams"
       <dave@xxxxxxxxxxxxxxxxxxxx>
cc:    "Meredith, Alisdair" <Alisdair.Meredith@xxxxxxxxxxxxxxxx>,
       <c++-pthreads@xxxxxxxxxxxxxxxx>
Subject:    Re: [c++-pthreads]  Re: FW: RE: Re: I'm Lost


Dave Butenhof wrote:

> So, yeah; the exception is synchronous. Fine. But that's only the
> final, and least interesting, step in the protocol. Or perhaps that's
> just "least interesting" to ME, because "I'm a thread guy". ;-)

It is a very interesting step because that's what the thread sees, an
ordinary exception, emanating from a function in the usual way; meaning
that
if the thread is already equipped to handle exceptions, as is the case with

C++ code nowadays, it "just works". Which is nice. :-)