ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> boost
boost
[boost] Re: [fsm] transition context and exit()
by Darryl Green other posts by this author
Jun 5 2004 1:07PM messages near this date
[boost] Re: [fsm] transition context and exit() | [boost] Re: [fsm] transition context and exit()
Andreas Huber <ah2003 <at>  gmx.net> writes:
>  you could still lose one exception because *non-error-handling* user code
>  (the exit actions) must be executed before the problem can be handled. If
>  this non-error-handling code fails we are in deep trouble.

Yes, exit is "special".

>  IIRC, one of the 
>  reasons why to never propagate exceptions from destructors is very similar 
>  (see Herb Sutter, Exceptional C++).

Yes. The similarity had occured to me also.

>  I have reached sort of a conclusion:
>  
>  1. boost::fsm users want to have the option to just let exceptions "fly" 
>  through the framework and let the state machine client handle the problem. 
>  Whenever this happens the state machine object is no longer usable. Before 
>  handing the exception to the user, the framework should probably destruct 
(but 
>  not exit) all state objects. Users can propagate exceptions from exit actions.

A useful option.

>  2. boost::fsm users might want to gracefully handle exceptions propagated 
from 
>  actions and continue to use the state machine object afterwards. If so, they 
>  must accept that exit actions must not propagate any exceptions. This is 
>  because it seems that, no matter how action failures are handled in a state 
>  machine, in general exit actions must be executed before an error-handling 
>  state can be reached.

Agreed. Specifically, if the action failure transition is not to an inner state 
of the ICOS of the failed transition, exit actions must not throw. Of course, 
if you were to accept my proposal to allow actions to occur at any level in the 
transition, that would become ".. an inner state of the transition action 
context or the ICOS, whichever is the innermost...".

>  I think the only way to avoid the non-throwing exit actions in 2 is to use 
the 
>  ephemeral error state or the exit() error handling you proposed for *all* 
>  failures, not only for exit.

Ok - that sounds like it would be the only sufficiently regular/comprehensive 
alternative to (1) to be worthy of further consideration.

>  It is worth to explore this some more.
>  What do you think?

I am not sure if anything other than (1) is really useful. I think (2), if 
exception handling within the fsm framework is to be really useful, is too 
restrictive. I think (3) (meaning 2 with the modifications to allow exit to 
fail) might be too restrictive/hard to use to be really useful. It is the last 
point I'd really like to hear from others on. I find the idea interesting, but 
I wouldn't actually encourage you to invest effort in implementing it at this 
stage.

Regards
Darryl.

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Thread:
Andreas Huber
Andreas Huber
Andreas Huber
Darryl Green
Darryl Green
Darryl Green
Darryl Green
Andreas Huber
E. Gladyshev
Andreas Huber
Andreas Huber
E. Gladyshev
E. Gladyshev
Darryl Green
Andreas Huber
Johan Nilsson
Darryl Green
Andreas Huber
Andreas Huber
Rob Stewart
Andreas Huber
Rob Stewart
Johan Nilsson
Andreas Huber
Andreas Huber
Johan Nilsson
Johan Nilsson
Andreas Huber
Andreas Huber
Andreas Huber
Darryl Green
David Abrahams
Andreas Huber
Andreas Huber
Rob Stewart
Andreas Huber
Andreas Huber
Andreas Huber
Andreas Huber
David Abrahams
David Abrahams
David Abrahams
Andreas Huber
Andreas Huber
Darryl Green
David Bergman
David Abrahams
David Abrahams
David Abrahams
Andreas Huber
Andreas Huber
David Abrahams
Andreas Huber
Andreas Huber
Andreas Huber
Andreas Huber
Darryl Green
Andreas Huber
Robert Bell
David Abrahams
E. Gladyshev
Johan Nilsson
Jeff Flinn
Johan Nilsson
Andreas Huber
Jeff Flinn
E. Gladyshev
Andreas Huber
Andreas Huber
Iain K. Hanson
Robert Bell
David Abrahams
E. Gladyshev
Andreas Huber
Andreas Huber
David B. Held
Andreas Huber
Johan Nilsson
Johan Nilsson
Peter Dimov
Johan Nilsson
Topher Cooper
Johan Nilsson
Johan Nilsson
Andreas Huber
Robert Bell
Andreas Huber
Andreas Huber
Andreas Huber
E. Gladyshev
Andreas Huber
Andreas Huber
E. Gladyshev
E. Gladyshev
Andreas Huber
Andreas Huber
E. Gladyshev
David Abrahams
Andreas Huber
E. Gladyshev
E. Gladyshev
Rob Stewart
E. Gladyshev
E. Gladyshev
Rob Stewart
E. Gladyshev
Rob Stewart
E. Gladyshev
Andreas Huber
Andreas Huber
E. Gladyshev
Marshall Clow
Marshall Clow
E. Gladyshev
David Abrahams
Darryl Green
E. Gladyshev
Andreas Huber
Andreas Huber
Robert Bell
Darryl Green
Pavel Vozenilek
David Abrahams
Andreas Huber
David Abrahams
Gregory Colvin
Pavel Vozenilek
Andreas Huber
Robert Bell
Andreas Huber
Johan Nilsson
Andreas Huber
Andreas Huber
Johan Nilsson
Johan Nilsson
Rob Stewart
Johan Nilsson
Andreas Huber
Andreas Huber
David Abrahams
Andreas Huber
Andreas Huber
David Abrahams
Andreas Huber
Andreas Huber
Johan Nilsson
Rob Stewart
Kwee Heong Tan
David Abrahams
Andreas Huber
David Abrahams
David Abrahams
Andreas Huber
Andreas Huber
Andreas Huber
David Abrahams
Andreas Huber
John Fuller
David Abrahams
David Abrahams
Andreas Huber
Andreas Huber
Aleksey Gurtovoy
David Abrahams
David Abrahams
David Abrahams
Andreas Huber
David Abrahams
David Abrahams

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved