Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost MSM - Ways to send info out from state machine to outside world
From: Christophe Henry (christophe.j.henry_at_[hidden])
Date: 2011-09-10 16:00:21


> One more question. So how do the guard conditions work? Does the state
> machine keep checking periodically if the guard condition is satisfied or
> not and make transition if the condition is met or it checks for the
> condition only when an event occurs?
>
> Thanks!

No. This would be again my metaphors about eating your cycles. It would also
require an extra thread and this would be the race condition stuff.
The guards are evaluated when you process an event.
When you call process_event(event()), the state machine does:
- check the guard. If true:
   - call the exit action
   - call the transition action
   - call the entry action
- else: check if another transition is possible. If yes, repeat, otherwise
stop.

Then it does nothing again.

HTH,
Christophe


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net