Should wasi resources be locked behind a mutex, or are we relying on the wasm apps themselves to ensure that data is accessed in a safe way?
We don't yet have thread support in WASI 0.2, so it technically doesn't come up yet. Core wasm support is being worked on, and once that's complete, we'll need to design support for the component model, and that's when we'll need to answer questions about how threads and handles interact.
So for now no thread safety, right?
Right; for now, you can assume there's only one thread.
Sounds good. Thanks!
One thing I'd recommend though, in Rust at least, is to assert!(!cfg(target_feature = "atomics"))
whenever you write a single-threaded assumption to send up a warning flag if threads support is added in the future
Last updated: Nov 22 2024 at 16:03 UTC