Will there be an option at some point to use a Web Worker based thread pool and sharedarraybuffer in conjunction with the current WASI thread/async stuff?
Hey @Srayan Jana the right place for that question is probably #jco since I assume you mean on the host -- would you mind sharing a bit about the use case you're trying to prepare for?
Also, when you say WASI threads, I assume you mean threads as expressed in the canonical ABI docs -- is that right?
Note that stackful coroutines which will land at some point (right now jco only has support for stackless coroutines) will land at some point in the future, but it does not necessarily require a thread pool. In the future though we should be able to get true parallelism via a thread pool, and synchronization will of course require things like SharedArrayBuffers, etc.
So I think the answer to your question is yes
Yeah I guess this should be in JCO.
The use case I’m thinking of is using like Go, or Rust + Tokio in the browser with “real” threads backing it.
Right now it’s annoying whenever I’m doing rust apps that rely on async code to create two versions, one that uses Tokio so I can compile the app for native, and one that uses custom async wasm stuff for WASM
Ah yes, that makes sense! We don't yet have mechanisms for this, but it's definitely something that should happen. Lots of time between here and there, but as coop threads are a 0.3.x feature that's well on it's way, the implementation in Jco should be on the horizon as well.
We'll almost certainly start with the concurrent version but eventually we should be able to explore the truly parallel version
Srayan Jana said:
Yeah I guess this should be in JCO.
The use case I’m thinking of is using like Go, or Rust + Tokio in the browser with “real” threads backing it.
Right now it’s annoying whenever I’m doing rust apps that rely on async code to create two versions, one that uses Tokio so I can compile the app for native, and one that uses custom async wasm stuff for WASM
What do you mean by "in the browser"?
Rust toolchain is over 1 GiB, so that probably ain't happening. I'd suggest using Native Messaging.
Basically you can just write to ArrayBuffer and SharedArrayBuffer using wasi:cli STDOUT and STDOUT, or copy/read from/write to memory.
@guest271314 please don't spam every conversation with mentions of native messaging. This conversation isn't about anything related to that (nor is it about running the Rust toolchain in the browser)
Last updated: Jul 29 2026 at 05:03 UTC