Boost logo

Boost :

From: Alexander Terekhov (terekhov_at_[hidden])
Date: 2002-09-27 08:59:39


< apropos "synchronized" -- i.e. multithreading ;-) >

David Abrahams 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. ;-) ;-)

regards,
alexander.


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