question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Atomics.wait support

See original GitHub issue

Howdy, cool project! Curious if you have any plans to support signaling via Atomics.wait to avoid the need for hard polling?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
padenotcommented, Feb 8, 2022

I wonder if it’s possible to port one of the moderne work-stealing queue algorithms in the current state of nodejs’ ecosystem, that would probably be the best you can do (not knowing too much about the problem though).

0reactions
asilvascommented, Feb 7, 2022

I understand now this package was designed for web so I’ll move on. My background on this topic is with POSIX so I’ll investigate the low levels more in node/v8 to determine the feasibility/tradeoffs of leveraging notify/wait. Long story short, I have many threads processing commands and I don’t want those threads each consuming 100% of each CPU core. My current implementation leverages postMessage (which works well) but even with efficient v8 serialization there is still considerable overhead for real-time software, thus why I’m looking into leveraging ring buffers for many-to-many thread communication. Thanks for taking the time!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Atomics.wait() - JavaScript - MDN Web Docs
The Atomics.wait() static method verifies that a given position in an Int32Array still contains a given value and if so sleeps, awaiting a...
Read more >
JavaScript built-in: Atomics: wait | Can I use... Support ...
"Can I use" provides up-to-date browser support tables for support of front-end web technologies on desktop and ... JavaScript built-in: Atomics: wait.
Read more >
JavaScript Atomics.wait() Method
The Atomics.wait() in JavaScript is an in-built method that is used to verify whether a given position in an Int32Array still contains a...
Read more >
Atomics.wait, Atomics.notify, Atomics.waitAsync
Atomics.wait is only usable on worker threads. V8 version 8.7 now supports a non-blocking version, Atomics.waitAsync, which is also usable ...
Read more >
Can we relax Atomics.wait to allow waiting on the main ...
In multithreaded applications, there is the .wait() primitive that allows one to synchronously wait on Worker threads.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found