Stream: general

Topic: Should wasi resources be stored behind a mutex?


view this post on Zulip Mendy Berger (Feb 16 2024 at 02:08):

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?

view this post on Zulip Dan Gohman (Feb 16 2024 at 02:15):

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.

A draft proposal for spawning threads in WebAssembly - WebAssembly/shared-everything-threads

view this post on Zulip Mendy Berger (Feb 16 2024 at 02:16):

So for now no thread safety, right?

view this post on Zulip Dan Gohman (Feb 16 2024 at 02:16):

Right; for now, you can assume there's only one thread.

view this post on Zulip Mendy Berger (Feb 16 2024 at 02:16):

Sounds good. Thanks!

view this post on Zulip Alex Crichton (Feb 16 2024 at 15:54):

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