Boost logo

Boost :

Subject: Re: [boost] [transact] Handling with user exceptions
From: strasser_at_[hidden]
Date: 2010-03-01 17:39:33


Zitat von "vicente.botet" <vicente.botet_at_[hidden]>:
> I would like to initiate a discussion on how to manage with user
> exceptions. Here follows some thougth I'm implementing in Boost.STM.
>
> There are two main ways to manage with user exceptions:
> * exceptions commit transactions - corresponds to the current C++ behavior
> * exceptions abort on exit - corresponds to rollback

I think we should look at this from the user's perspective first and
why he would use either of those ways to manage exceptions.

this guideline on exception safety can help us a lot in this I think:
http://www.boost.org/community/exception_safety.html

by the definitions of section 3 there, transactions are nothing more
than a vehicle to achieve the "strong" exception guarantee.

using "exceptions commit transactions" by your definitino above (which
imho does not correspond to current c++ behaviour, if you follow
exception guidelines) would mean that you intentionally only use a
"basic" exception guarantee for a certain function/transaction scope.

why would that be desirable?
as section 5 of david abrahams' paper notes, "From a client's
point-of-view, the strongest possible level of safety would be
ideal.", and then goes on with considerations on when to accept a
"basic" guarantee for performance reasons.

these don't apply for us, as we already impose the overhead described
in paragraph 2 on every operation.

Best,


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