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: [prereview request][fsm]
by David Abrahams other posts by this author
May 23 2004 7:06PM messages near this date
[boost] Re: [prereview request][fsm] | [boost] Re: [prereview request][fsm]
"Andreas Huber" <ah2003@[...].net>  writes:

>  Hi Dave,
> 
>  [snip]
> > After a brief glance, it looks like a very sophisticated and
> > well-thought-out library.
> 
>  Thanks :-)
> 
> > I'd like to know if following state
> > transitions require dynamic allocation or not.
> 
>  By default (i.e. when you define states as demonstrated in the tutorial), a
>  dynamic allocation happens in the course of every state entry. However,
>  since users define all state classes themselves, they have full control over
>  how each state will be allocated (see "Memory management customization" in
>  the rationale).

OK, that's still dynamic allocation, but it may be good enough.

Also, do I note that there's always function pointer indirection for
event dispatch?  While you clearly need something like that if
there's an event queue, the MPL samples I posted earlier don't make
you pay for that in the cases where you don't need it.

>  [snip]

> >> Out of the box, state_machine<> does the following:
> >>
> >> 1. The exception is caught
> >
> > By the state machine framework?
> 
>  Yes.

Clarification in the text would be good.

> >> 2. In the catch block, an exception_thrown event is allocated on the
> >>    stack
> >>
> >> 3. Also in the catch block, an immediate dispatch of the
> >>    exception_thrown event is attempted.
> >
> > Hum.  So basically, any throwing code that could be invoked from
> > processing exception_thrown and from processing some other event had
> > better be re-entrant?
> 
>  Yes. However, I don't think this will happen in practice. Code that is
>  executed as a result of the processing of an exception_thrown event is
>  typically very different from code that is executed during normal state
>  machine operation. Moreover, if code reacting to an exception_thrown event
>  throws itself an exception then this exception will under all circumstances
>  be propagated to the state machine client. That is, error handling code does
>  not have to be reentrant.

OK.

> >>    That is, possibly remaining events in the queue are dispatched
> >>    only after the exception has been handled successfully
> >
> > I don't understand the relationship here.
> 
>  A state machine can post internal events (simple_state<>::post_event())
>  while processing an event. Those internal events are pushed into a queue and
>  processed as soon as the state machine has finished processing the current
>  event. If an exception is thrown while processing any of these events, the
>  resulting exception_thrown event "overtakes" the still queued events.

OK.

> >> 4. If the exception was handled successfully
> >
> > What does that mean?  Who signals "successful handling", and how do
> > they do it?
> 
>  This is explained a bit further down under the title Successful exception
>  handling. I agree that this is probably a bit hard to find. I've added a
>  link in my version.

Thanks.

-- 
Dave Abrahams
Boost Consulting
http://www.boost-consulting.com

_______________________________________________
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