tc39 / proposal-atomics-wait-async

"asynchronous atomic wait" for ECMAScript
https://tc39.github.io/proposal-atomics-wait-async/
Other
89 stars 18 forks source link

Note: Return value of `wake` may not accurately reflect waiters woken, if enormous #4

Open lars-t-hansen opened 6 years ago

lars-t-hansen commented 6 years ago

More of a note than an issue, I don't see this as a problem for JS.

Background: https://github.com/WebAssembly/threads/issues/72. With this lightweight wait mechanism, it is possible to create a very large number of waiters with modest resource use. On 64-bit systems with 64-bit physical addresses and RAM/swap to back it we can conceivably go past 2^53 waiters. This means the result of wake without a count may not be able to represent the number of woken waiters precisely in its return type, which is Number. To consumers that care, the loss of accuracy will however be detectable (the value is no longer an integer).