Replies: 1 comment 1 reply
-
Found an answer to 1. myself in the documentation. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am using the
wasm_c_api
to create a Wasm host in a real-time scheduler and run exported functions of a reactor guest from the scheduler.The realtime scheduler has a non-realtime initialization phase where I create the
wasm_store_t
and all its objects.Then the realtime scheduler can be switched to its operating phase where the exported functions of the reactor guest are called in realtime (periodically or event-driven).
According to the
wasm_c_api
documentation, thewasm_store_t
and all its objects need to be accessed from the same thread.Unfortunately, the real-time scheduler uses different threads in the non-realtime initialization phase and in the realtime operating phase. This creates an error because the
wasm_runtime
uses thread local storage for it's implementation.The source code shows, that thread-local storage is only needed for the hardware bound check.
Disabling the hardware bound check
enables to initialize the runtime and call the exported functions from different threads. Everything works fine.
Now my questions:
Thanks for any hints and explanations.
FJG
Beta Was this translation helpful? Give feedback.
All reactions