W3C home > Mailing lists > Public > www-voice@w3.org > January to March 2013

RE: revised mainEventLoop

From: Jim Barnett <Jim.Barnett@genesyslab.com>
Date: Fri, 8 Mar 2013 12:57:48 +0000
To: David Junger <tffy@free.fr>
CC: "www-voice@w3.org" <www-voice@w3.org>
Message-ID: <57A15FAF9E58F841B2B1651FFE16D2810266AB@GENSJZMBX03.msg.int.genesyslab.com>
The intent is that eventless transitions always take priority, so we test them first each time around the loop.  For example, suppose we take a transition from S1 to S2 on internal event e.  The first thing we do in S2 is test for eventless transitions.   Even though there were no eventless transitions enabled in S1 (if there were, we would have taken them instead of dequeuing e), there may be new ones enabled once we reach S2.  S1's onexit handlers, the executable content in the transition, or S2's onentry handlers may all have modified the datamodel.  (The most obvious use case would be an onentry handler that counts how often you have  entered the state with eventless transitions providing special behavior based on the count.)

-          Jim

From: David Junger [mailto:tffy@free.fr]
Sent: Friday, March 08, 2013 5:13 AM
To: Jim Barnett
Cc: www-voice@w3.org
Subject: Re: revised mainEventLoop

Le 21 feb 2013 à 16:27, Jim Barnett a écrit :

        # Here we handle eventless transitions and transitions
        # triggered by internal events until macrostep is complete
        while running and not macrostepDone:
            enabledTransitions = selectEventlessTransitions()
            if enabledTransitions.isEmpty():
                if internalQueue.isEmpty():
                    macrostepDone = true
                    internalEvent = internalQueue.dequeue()
                    datamodel["_event"] = internalEvent
                    enabledTransitions = selectTransitions(internalEvent)
            if not enabledTransitions.isEmpty():

If I read it right, it means that eventless transitions are tested every time we dequeue an internal event. The only reason to do that would be if you had eventless transitions testing the contents of _event, which would be kind of hypocritical for "eventless" transitions. If that's not intented (and the fact that external events don't do that suggests it is not), then we should test eventless transitions just once, and then ignore those while consuming internal events.

Received on Friday, 8 March 2013 12:58:21 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:07:43 UTC