You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implementing Atomics.waitAsync based multithreading primitives to Emscripten WebAssembly code libraries, it was realized in WebAssembly/threads#176 that the ability to perform memory deinitialization after having issued a Atomics.waitAsync is severely impaired without a mechanism to cancel a waitAsync operation.
In that thread it was suggested that maybe a future machinery to enable cancelling a Promise might help the issue and let garbage collection to happen properly, without requiring sites to wrap all their multithreaded WebAssembly content inside iframes for GC to work.
Would Promise cancellation mechanism be suitable for fixing the current Atomics.waitAsync GC problem? Are there any rough eta estimates for Promise cancellation support to arrive in browsers? (2021? or later? or too early to tell?)
The text was updated successfully, but these errors were encountered:
The cancellation of async operations already exists in browsers (AbortController/AbortSignal), but that implementation depends on browser-specific APIs (i.e., EventTarget) that don't exist in ECMA-262. An alternative I've proposed is #22, defining a symbol-based cancellation protocol that could be recognized in ECMA-262 and implemented on top of AbortController/AbortSignal, or in user-land code.
I plan to bring cancellation (in this protocol form) back before committee later this year.
Implementing
Atomics.waitAsync
based multithreading primitives to Emscripten WebAssembly code libraries, it was realized in WebAssembly/threads#176 that the ability to perform memory deinitialization after having issued aAtomics.waitAsync
is severely impaired without a mechanism to cancel awaitAsync
operation.In that thread it was suggested that maybe a future machinery to enable cancelling a Promise might help the issue and let garbage collection to happen properly, without requiring sites to wrap all their multithreaded WebAssembly content inside iframes for GC to work.
Would Promise cancellation mechanism be suitable for fixing the current
Atomics.waitAsync
GC problem? Are there any rough eta estimates for Promise cancellation support to arrive in browsers? (2021? or later? or too early to tell?)The text was updated successfully, but these errors were encountered: