lingua-franca icon indicating copy to clipboard operation
lingua-franca copied to clipboard

Safe handling of physical actions in single-threaded C runtime

Open lhstrh opened this issue 2 years ago • 4 comments

Prior to these changes, it was not possible to asynchronously access the event queue from an interrupt service routine on bare-iron platforms. This PR -- currently still a work in progress -- should enable the use of physical actions on embedded platforms. Known issues:

  • [ ] the compiler currently forces the the use of the threaded runtime if there are physical actions; this behavior needs to be changed, but it's not clear how exactly. Not all embedded platforms are single-threaded.
  • ...

lhstrh avatar Sep 03 '22 00:09 lhstrh

The tracing tests are failing on Windows for both Python and C with ERROR_ACCESS_DENIED, which seems to just be the same as a segmentation fault, and I cannot reproduce the error locally, even on Windows.

petervdonovan avatar Sep 04 '22 18:09 petervdonovan

That is rather bizarre... 😔

lhstrh avatar Sep 04 '22 23:09 lhstrh

It sounds like a race condition. I believe that if tracing is enabled the threaded runtime is always used...

lhstrh avatar Sep 04 '22 23:09 lhstrh

See https://github.com/lf-lang/reactor-c/pull/106#pullrequestreview-1095541919

edwardalee avatar Sep 05 '22 09:09 edwardalee

This is ready for merge. Arduino is still supported as a target platform. I think you removed the support in reactor-c, so should we remove it here as well?

erlingrj avatar Dec 23 '22 03:12 erlingrj

Not sure about Arduino. It kind of depends on what @arengarajan99 is up to, but I haven't heard from him in a while.

lhstrh avatar Dec 23 '22 03:12 lhstrh