-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
Atomics.wait prevents postMessage being queued #21417
Comments
I'm not entirely sure this isn't the behaviour I'd expect. To be clear - you're doing this to prevent access to the ShardArrayBuffer while it is being moved around? |
@benjamingr in the reduced example above, the main thread should wait on the SharedArrayBuffer being notified that it should wake anyone waiting on it. The |
Okay, looked into it a bit, and the workers thing is a red herring here. Minimal reproduction:
i.e. the main script just doesn’t get executed if it’s file extension is (In your original example, |
@addaleax my main script is using |
@bmeck Try the example in the last comment, I think that it explains the issue better than words can
No – I’m saying it has nothing to do with workers |
@addaleax I don't understand . |
@bmeck If you create a script called
|
Are you saying that is related to I am running |
I can get the worker to log as well if I remove the line in question above. |
I think we’re seeing different things because the recently landed 8ee604c caused a regression in ESM that may be masking other issues :/ Will open a revert PR, then dig into it again |
@devsnek Can you land that? It seems like we should still revert the original patch asap if we can’t do that now? |
Okay, but with that patch applied I can’t reproduce the original problem here anymore … @bmeck Can you share the SHA you’ve built Node for? |
I'm running a fork of 31d5bde on https://github.com/bmeck/node/tree/service-loader/ I haven't written anything to change the Worker code. let me try and rebase to latest today. |
I can no longer reproduce this on new builds, closing . https://gist.github.com/bmeck/fb90b23234aee41f392d4a19b61ba6eb is my more complete reduced test for this working properly |
It appears that workers don't get sent messages if the sending thread uses
Atomics.wait
to block the thread sending the message.The text was updated successfully, but these errors were encountered: