-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[mono] add internal WebWorkerEventLoop utility class #84492
[mono] add internal WebWorkerEventLoop utility class #84492
Conversation
Tagging subscribers to 'arch-wasm': @lewing Issue DetailsThis is Part 3 of #84489 - landing support for async JS interop on threadpool threads in multi-threaded WebAssembly. Provides two pieces of functionality:
Note that this has a soft dependency on #83998 - without the emscripten bump,
|
Provides two pieces of functionality: 1. A keepalive token that can be used to prevent the current POSIX thread from terminating when it returns from its thread start function, or from an invocation from the JS event loop. When the last keepalive token is destroyed (assuming Emscripten isn't keeping the thread alive for other reasons) it will terminate as if by calling `pthread_exit` and the webworker will be made available to other threads 2. A `HasUnsettledInteropPromises` property that peeks `_js_owned_object_table` to see if there are any promises created by the interop subsystem that have not been fulfilled or rejected yet.
for mono_wasm_eventloop_has_unsettled_interop_promises we can't use the _js_owned_object_table size because it contains other interop objects, not just promises
dbe7140
to
fb3f7ab
Compare
And link to dotnet#85052 for more details
2822977
to
c0c1eed
Compare
@pavelsavara anything else I should address in this one? |
I'm ok about the code, but I don't understand the big picture. |
Yea it's used in the Part 4.
I wanted to make something that is harder to misuse than the emscripten What I like about the |
Thanks for explanation.
I'm not convinced this should be public API. Once we have use case for it we could re-consider it. For now, LGTM |
WBT failure is #85010 (which needs a dotnet/sdk fix to flow down) |
debugger test timeout is #84101 |
This is Part 3 of #84489 - landing support for async JS interop on threadpool threads in multi-threaded WebAssembly.
Provides two pieces of functionality:
A keepalive token that can be used to prevent the current POSIX thread from terminating when it returns from its thread start function, or from an invocation from the JS event loop. When the last keepalive token is destroyed (assuming Emscripten isn't keeping the thread alive for other reasons) it will terminate as if by calling
pthread_exit
and the webworker will be made available to other threadsA
HasUnsettledInteropPromises
property that peeks_js_owned_object_table
to see if there are any promises created by the interop subsystem that have not been fulfilled or rejected yet.