Skip to content
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

Add additional documentation to spawn_local #4391

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

drewcrawford
Copy link

This adds documentation to help troubleshoot why spawn_local might not work as expected.

see #2945 and chemicstry/wasm_thread#6

Copy link
Collaborator

@daxpedda daxpedda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Events, queueMicrotask, setTimeout and Scheduler.postTask() are also affected by this so the issue isn't specific to spawn_local(). I think there needs to be a general understanding that blocking in Wasm is much more often than not a bad idea compared to native.

So its probably better to add documentation to functions that block instead to all possible functions that are affected by blocking. In the case of wasm-bindgen its js_sys::Atomics::wait*. Additionally some top-level documentation somewhere would help make this information be conveyed much more generally.

Thank you for looking into this and going through the effort of a PR!

@daxpedda daxpedda added the waiting for author Waiting for author to respond label Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting for author Waiting for author to respond
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants