Enabling keepalive
if a physical action exists
#547
Locked
Soroosh129
started this conversation in
General
Replies: 2 comments
-
I thought we already had this. In any case, I think we should definitely set keepalive to true if there are physical actions. |
Beta Was this translation helpful? Give feedback.
0 replies
-
#546 has been merged into master. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Imagine the following LF program:
This program exits as soon as it starts. The only reason for this is that the (at least C and Python) runtimes think that no events exist in this program and
keepalive
is set to false. Therefore, they decide to exit the program. However, if a physical action exists, there is no way for the runtime to make such a determination by itself, since a physical action can produce an event at any given moment in perpetuity.This issue was recently rediscovered by @housengw while trying to implementation the C target sensor simulator in the Python target.
I would suggest that to err on the safe side, we should set
keepalive
to true when physical actions exist in a program, unless the user has explicitly set it to false. What do you think?I have created a draft PR that reflects the changes required for this feature in #546.
Beta Was this translation helpful? Give feedback.
All reactions