Boost logo

Boost Users :

Subject: Re: [Boost-users] Statechart problem
From: Iwan Sanders (iwan.sanders_at_[hidden])
Date: 2009-03-25 11:56:27

I've been printing the states and the "current" state seems to be the
expected one. On the otherhand the callback function is indeed being called
asynchronously (but I now for sure that is only fires in that state because
subscription only happens there).

If I would rewrite the code to use the asynchronous_state_machine I could
fire events through the fifo_scheduler and the problem would be solved?

On Wed, Mar 25, 2009 at 16:19, Igor R <boost.lists_at_[hidden]> wrote:

> > The UpdateNewCANMessage is a callback function defined in the
> > ICANMonitorClient interface. This method is being called when new data
> > frames arrive (that works) but then I want to notify the state machine to
> > proceed to its next state effectively by sending an EvNewFrame event but
> > nothing happens.
> >
> > I tried this->post_event( EvNewFrame() ); // no effect
> > and this->post_event( boost::intrusive_ptr<EvNewFrame>( new EvNewFrame( )
> )
> > ); // no effect
> >
> First of all, before calling post_event, you can try and print-out
> current states info (see StateChart tutorial). Besides, you can step
> into post_event in order to see what happens to that event.
> Just one little doubt: don't you try to post_event asynchronously to a
> regular state_machine? I.e. isn't UpdateNewCANMessage called from
> another thread? If so, it's not safe, as you can't be sure what
> exactly happens to the state_machine in that moment.
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at