What problem are you trying to solve?
When developers bring multithreaded libraries and applications to the Web, they are forced to use inefficient spinlocks because Atomics.wait currently throws an exception on the main browser thread. I am proposing that we improve application performance and energy usage for end users by changing the platform to allow Atomics.wait (and its WebAssembly equivalents) on the main thread.
What solutions exist today?
Please see the explainer for a full explanation of the problem, what developers do today, and various possible solutions. There is also existing discussion and developer feedback at WebAssembly/shared-everything-threads#112.
How would you solve it?
The simplest fix would be to update the HTML spec to set canBlock to true instead of false when creating similar-origin window agents.
Anything else?
I know this proposal blatantly violates the "do not block the main thread" design principle, but this is a special case and the status quo is worse, so please give the explainer a read!
What problem are you trying to solve?
When developers bring multithreaded libraries and applications to the Web, they are forced to use inefficient spinlocks because
Atomics.waitcurrently throws an exception on the main browser thread. I am proposing that we improve application performance and energy usage for end users by changing the platform to allowAtomics.wait(and its WebAssembly equivalents) on the main thread.What solutions exist today?
Please see the explainer for a full explanation of the problem, what developers do today, and various possible solutions. There is also existing discussion and developer feedback at WebAssembly/shared-everything-threads#112.
How would you solve it?
The simplest fix would be to update the HTML spec to set canBlock to true instead of false when creating similar-origin window agents.
Anything else?
I know this proposal blatantly violates the "do not block the main thread" design principle, but this is a special case and the status quo is worse, so please give the explainer a read!