-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
Use Web Workers for true concurrency #11
Comments
Have you seen go-app? https://github.com/maxence-charriere/go-app it uses web workers |
https://github.com/realPy/hogosuru/blob/main/broadcastchannel/broadcastchannel.go#L4 might help ! Been using all of this code with gio: realPy/hogosuru#36 |
FYI I've made some progress with Workers, though it's been slow-going. MessagePorts are great, but they sure are hard to debug when they're inside the runtime. I think after this is implemented, I might reorganize everything – I can only name so many different objects "worker," "process," and "filesystem" before I start going crazy 🙃 |
Thanks for the contributions @gedw99 You're awesome 😄 |
looking forward to seeing this. I am trying to use services workers, and to also have the exact same things running outside WASM. This will allow the same golang wasm to run inside a browser, as well as on any other device. |
If oyu have a branch or code to look at even if its in bad shape, let me know. It will be interesting to me for my work in matching the Browser environment in a non browser environment. |
Thanks 🙏 @JohnStarich for the heads up. is it ok if I wait until it’s finished as it’s holidays here and I am trying to avoid work stuff as much as possible |
No worries! I'm slowly attacking the problem bit by bit, eventually we'll get it done 😄 |
Building parallelized programs w/ Go in the browser w/ WebWorkers is one of the goals of ControllerBus: https://github.com/aperturerobotics/controllerbus There's a lot of time invested towards building modular pluggable programs in that repo, communicating via IPC over MessageChannel. It could be useful for this purpose. |
Interesting. Thanks for sharing @paralin |
This problem has been haunting me for quite some time 🙂 I'm still working on it, though progress remains slow. A new implementation has been pushed. This one crashes less and the design is slightly improved. Just need to figure out these silly crashes. The traces are incredibly unhelpful 🤔 |
Made some good progress. Finally found and fixed a callback blocking the event loop which triggered a crash loop. Now, onto making pipes work across MessageChannels! |
Finally have the draft PR working with web workers 🎉 The next major part after web workers is attempting to parallelize the calls to the |
In our project, we used postMessage to communicate with a web worker. |
@JohnStarich any luck on this? This seems like the big refactor that this project needs and last update sounded positive! |
The biggest performance bottleneck for hackpad right now appears to be true parallelization. The Go CLI performs starts compile and link processes, which could benefit greatly with real parallelization and moving off of the main thread (even though they run in the background).
Going further, I think it could make sense to set up the kernel as a single SharedWorker, with each browser tab representing a new abstract "worker" concept that can run processes. Each tab would start by registering itself as a worker and "requesting" an editor be spawned on itself. Using a single kernel would keep overhead much lower, and enable some interesting inter-tab and project behaviors.
Moving from a single main/background thread to multi-worker is a big undertaking, so this could take a while.
The text was updated successfully, but these errors were encountered: