[c++-pthreads] Re: thread-safety definition
Alexander Terekhov
boo at terekhov.de
Wed Jan 21 14:07:10 UTC 2004
Dave Butenhof wrote:
>
> Alexander Terekhov wrote:
>
> >Dave Butenhof wrote:
> >[...]
> >
> >
> >>OK, but while I can see several ways in which an implementation of this
> >>might not do what you'd like, I still fail to see how you mean it'll
> >>"break" catch(...).
> >>
> >>
> >In the current C++, if an exception can be caught by name it can also
> >be caught anonymously by catch(...). I want the same program behavior
> >(in that "example") if I replace catch-by-name with catch(...). Of
> >course, you'll say that catch(...) isn't really broken here and that
> >it's the lack of catch-by-name that changed the behavior... that's
> >why I wrote "break", not break. ;-)
> >
> >
> No, you're missing the point. I'm not talking about exception handling
> as such; I'm talking about dynamic scoping for cancellation, using C++
> exception scoping and throw clauses as (at least part of) the set of
> syntactic markers. I was suggesting, hypothetically, for discussion
> purposes, that cancellation might never occur within a catch(...) scope
> by default (unless something else is done, such as nesting a
> catch(cancel)). So it's not that catch(...) wouldn't catch a cancel
> exception... it WOULD, if the catch(cancel) re-threw it.
I don't like that. I agree that throw clauses shall affect thread
cancelability, but I don't like the idea to "empower" catch(...)
with the ability to disable cancelability in a similar way. To me,
this isn't intuitive. I still think that such catch(...) is sort
of "broken".
> It's simply
> that, by default, the exception would never occur in that scope.
>
> (And I also realize that I, accidentally, did a "REPLY" rather than a
> "REPLY-ALL" yesterday, and this little side discussion is inadvertently
> private. Oh well.)
Fixed.
>
> --
> /--------------------[ David.Butenhof at hp.com ]--------------------\
> | Hewlett-Packard Company Tru64 UNIX & VMS Thread Architect |
> | My book: http://www.awl.com/cseng/titles/0-201-63392-2/ |
> \----[ http://homepage.mac.com/dbutenhof/Threads/Threads.html ]---/
regards,
alexander.
More information about the c++-pthreads
mailing list