-
-
Notifications
You must be signed in to change notification settings - Fork 88
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
Apps with unyielding loops in goroutines hang on web #1416
Comments
Another possible, though perhaps not practical solution is just to avoid the use of goroutines altogether. I had to do that for such webassembly animations which compile with tinygo because tinygo only supports single-thread usage. Another perhaps more practical solution might be to use multiple wasm binaries. I do believe that they will execute on different threads but check me on that as I'm not 100% certain. However, this will likely cause substantial increase in the size of the page resources, possibly doubling the total cumulative size of the wasm binaries. And it might be very complex for ... I opted for the latter approach for a similar globe animation + shopping cart wasm application (not a cogentcore application). When I split the code into two separate files and compiled them each to their own wasm binary, it removed the stutter from the animation which was introduced by the combined source code. What was very strange in the case I just mentioned, even when other function calls were not executed, but included behind a function that blocked further execution - i.e.:
the mere presence of the I have no explanation for that behavior, and it wasn't caused by a goroutine in this case. |
@0pcom Thank you for the ideas. Although it is not possible to completely remove goroutines at this time, your idea did give me an idea for how to fix this. Instead of using a separate ad-hoc goroutine for the render loop of a canvas, we will add an I will implement and document that when I have the time to do so. Please also note that #1429 is the long-term complete solution to issues like this. |
…AnimationFrame; makes web more smooth and fixes freezing with animations (fixes #1416)
Describe the bug
See #1407 (reply in thread), golang/go#65178, golang/go#60857.
How to reproduce
See #1407 (reply in thread).
Example code
No response
Relevant output
No response
Platform
macOS
The text was updated successfully, but these errors were encountered: