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

Please implement Atomics.waitAsync as well! #20

Closed
tlively opened this issue Jan 29, 2023 · 4 comments
Closed

Please implement Atomics.waitAsync as well! #20

tlively opened this issue Jan 29, 2023 · 4 comments

Comments

@tlively
Copy link
Member

tlively commented Jan 29, 2023

The stage 3 Atomics.waitAsync proposal combined with JSPI will allow Emscripten to stop busy-waiting for locks, condition variables, and other blocking synchronization primitives on the main thread, which will be a great win for performance and efficiency for large, multithreaded applications. It would be great if we could assume that the presence of JSPI implied the presence of Atomics.waitAsync across browsers so we don't have to maintain a polyfill or continue busy waiting.

@fgmccabe
Copy link
Collaborator

I don't think that I would support adding an explicit dependency here. What is the implementation status of atomics?

@tlively
Copy link
Member Author

tlively commented Jan 30, 2023

This is just an informal request for implementers to consider :)

Atomics.waitAsync is its own TC39 proposal, and while all browsers support general Atomics, only blink currently supports Atomics.waitAsync.

@ajklein
Copy link
Collaborator

ajklein commented Jul 13, 2023

Some updates:

  • Atomics.waitAsync made it to Stage 4 and is now merged into the core JS spec
  • It's supported in Safari 16.4
  • Firefox seems to be the remaining non-supporting browser (tracking bug).

@eqrion FYI as you're thinking about prioritizing JSPI work.

@fgmccabe
Copy link
Collaborator

Current semantics of JSPI should address this question.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants