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: Re: [fsm] transition context and exit()
by Andreas Huber other posts by this author
Jun 4 2004 9:58PM messages near this date
Re: [boost] Re: Re: Re: [fsm] transition context and exit() | [boost] Re: [fsm] transition context and exit()
E. Gladyshev wrote:
>  ----- Original Message -----
>  From: "Andreas Huber" <ah2003@[...].net>
>  [...]
>  It's been a long discussion.
>  It'd be helpful if you could summarize the proposed changes
>  on d'tor/exit() and exception handling in general.

Ok, I will.

> > 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.
> 
>  If "fly through" is what I think it is (exceptions are not caught by
>  the framework),
>  it is one or another. You cannot "let exceptions "fly" through the
>  framework"
>  and destroy all states at the same time.

What I meant was the default behavior we were talking about before. I
rephrase, trying to stick more to accepted exception handling terminology:
1. By default, boost::fsm is completely neutral to exceptions. All
exceptions thrown by user actions are propagated to the state machine
client. If such an exception is caught by client code, all state objects are
destructed (but not exited). This ensures that the state machine object is
in a defined state if client code uses it after handling the exception.
State objects are constructed on state entry. On state exit, the states
exit() function is called (if present) and the state object is destructed
afterwards. Exceptions can be propagated from all user code except state
destructors.

> > 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.
> 
>  I believe that it is similar to how things
>  work now (with the default ExceptionTranslator)?

Yes.

> > 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. It is worth to
> > explore this some more.
> >
> 
>  "ephemeral error state" makes me nervous. :)

Me too. I haven't got very far yet on the precise semantics. Whenever I try
to formulate how exit() failures are handled I find myself trapped in
inconsistencies. Contrary to Darryls proposal my gut feeling is that we have
not left a state when its exit action fails. As a result, the exit() action
of a particular state object could be called more than once, which I find
*very* strange. Maybe Darryls way to handle things is better nevertheless
...

Regards,

Andreas


_______________________________________________
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