-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does this support threads? #46
Comments
Threads are not yet supported. I do want to support them, but I don't think it will be a trivial change. webworkers don't allow sharing javascript objects, so directly sharing the |
Yeah, I am aware that message passing is crucial between web workers to send messages in JS. However in native languages like Rust, you can simply share native channels inside I think we should guide the users about only two things:
I have experience with web workers and |
There are two shared memories that are necessary. One shared between the wasm instances for each thread and one for the message passing. browser_wasi_shim can't use the shared memory used by wasm for message passing as that would likely cause corruption for the wasm module if it thinks it can write to memory while at the same time browser_wasi_shim is using it for the message passing. I think it would be possible to have a method on
Absolutely! |
Having trouble with synchronization? https://dev.to/adamdbradley/how-partytown-s-sync-communication-works-4244 |
Blocking http requests to a service worker is an interesting hack. I'm afraid it will deadlock if a service worker gets a channel message (for sending non-serializable things like the shared memory to write to) and http requests to service in the wrong order. And it also doesn't really help with the debugging side of things. Any multithreading makes debugging so much harder with current browser debugger implementations. I tried implementing thread support a while back, but hit several debugger crashes, broken single stepping behavior, breakpoints not working and other bugs. |
Hi, thanks for this wonderful effort :)
I'm very interested in running thread code from WASI
.wasm
file on the browser. Is it possible right now? If not, can I make a PR for that using web workers?The text was updated successfully, but these errors were encountered: