Re: Link that deactivate itself, action postponed ? ...

Andreas Kraft (kraft@fokus.gmd.de)
Mon, 3 Nov 1997 13:30:09 +0100 (MET)

Emmanuel,

On Mon, 3 Nov 1997, Emmanuel BEUQUE wrote:

> Following what it is said at the last sentence of section 53.3, "it is
> possible for a link to deactivate itself in its LinkEffect. Such an action
> shall be postponed until the LinkEffect has been completely executed."
>
> This last sentence seems problematic to me. Suppose the linkEffect
> deactivate itself and then make an action that would cause the link to fire
> again it it was active.
>
> Shall we understand that we would go into an infinite loop or should
> we rather considered that :
>
> The link is deactivated immediately but all remaining elementary actions
> keep queued in the execution stack managed by the MHEG-5 engine.
>
> (That's a proposal of modification for section 53.3).

No, there is actually no problem. The fourth paragraph of 53.3 says:

"As a direct result of a LinkEffect being executed, synchronous events
may occur. These events shall be dealt with directly by the MHEG-5
engine. In other words, after the execution of each elementary action,
the MHEG-5 engine shall check if any additional Links have fired as the
result of a synchronous events occurring. If this is the case, that Link
and all its effects shall be completely processed before the MHEG-5
engine continues to process the next elementary action of the original
Link."

> [example]
> What would be the behaviour of this scene when it is running ?
>
> -Link 2 is fired and activate link 3
> -Link 2 testVariable action generates an event that matches both link 3 at
> link 4 conditions but only link 3 is activated
> -link 3 is fired and should deactivate itself (but action postponed ?...)
> -link 4 is activated
> -link 3 testVariable action generates a new event that matches link 3 and 4.
> But here, SHALL LINK 3 BE CONSIDERED AS ACTIVE OR NOT ?

Yes. Because link 3 is deactivated _after_ the execution of all it's
elementary actions. That means it is still active when the second TestVariable
action is executed.

> If link 3 must still be considered as active, there is an infinite loop.

Right.

> Moreover, if this is the case, I don't see any purpose of the ability for a
> synchronous link to deactivate itself. It would be only useful for
> asynchronous links.

Hmm, there are only synchronous and asynchronous events but no links.
I don't have an example ready but I think it might be usefull in some
cases...

Best regards,

Andreas

--
  o  _     Andreas Kraft
 (\_|_)      GMD FOKUS, kraft@fokus.gmd.de, +49 30 3463-7232
 T> ] [        The sky is the limit