Skip to content
This repository has been archived by the owner on Jan 5, 2021. It is now read-only.

Avoiding Infinite Loops in Event-Driven Execution Semantics #2858

Open
aly-farahat opened this issue Nov 1, 2019 · 0 comments
Open

Avoiding Infinite Loops in Event-Driven Execution Semantics #2858

aly-farahat opened this issue Nov 1, 2019 · 0 comments

Comments

@aly-farahat
Copy link

One way to avoid infinite loops in event-driven execution semantics is to adopt a hybrid execution approach. In this approach, there is a fundamental time-based cycle execution. All generated events in a particular cycle are to be handled in the next timed-cycle. One way to implement that is to queue all the events generated in cycle n into their corresponding input queues. At the beginning of cycle n + 1, the number of events in both internal and external queues are measured, then this number of events is handled similar to an event-driven semantics. After the event quota is reached, the execution sleeps until the next timed cycle (n+2) and reiterates the process.

This way, we get the benefit of both worlds,
1- Avoid potential infinite execution without sleeping, as we have a finite number of events to be handled every cycle,
2- Avoid the burden on the designer where he has to think about the order in which events are handled; i.e., the notion of downstream execution.

The proposal is to add a @hybrid_based keyword to support this semantics in addition to the existing ones.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants