Boost logo

Boost :

From: Alexander Terekhov (terekhov_at_[hidden])
Date: 2002-10-04 15:00:00


"Victor A. Wagner, Jr." wrote:
[...]
> > > {
> > > vector1.push_back(e1);
> > > try {
> > > vector2.push_back(e2):
> > > }
> > > catch(...) {
> > > vector1.pop_back();
> > > throw;
> > > }
> > > }
> > >
> > > And now you have not only the basic, but the strong guarantee (unless...
> >
> >unless the entire thread running vector2.push_back(e2) gets >>canceled<<
> >hitting some cancellation point or async-cancel region... on "some"
> >C/*C++* implementation that DOESN'T invoke catch(...) handlers on thread
> >cancellation (or exit)... and this IS "industry practice" (AIX, Solaris,
> >pthreads-win32/non-VCE, probably z/OS, etc.), nowadays, BTW. ;-) ;-)
>
> which, of course, means you can never do exception safe things in such an os

Well, just in case you've missed it... the entire problem is that "in
such an os" thread cancel and thread exit aren't C++ exceptions. (or
"something else"(*) that would kinda-work with C++-catch(...)-thing)

regards,
alexander.

(*) like C/SEH exceptions. ("forced unwinding" aside for a moment ;-) )


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk