-
Notifications
You must be signed in to change notification settings - Fork 4.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
[browser][MT] dispatch across threads via emscripten #97669
Merged
pavelsavara
merged 8 commits into
dotnet:main
from
pavelsavara:browser_mt_emscripten_dispatch
Feb 5, 2024
Merged
[browser][MT] dispatch across threads via emscripten #97669
pavelsavara
merged 8 commits into
dotnet:main
from
pavelsavara:browser_mt_emscripten_dispatch
Feb 5, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pavelsavara
added
arch-wasm
WebAssembly architecture
area-System.Runtime.InteropServices.JavaScript
os-browser
Browser variant of arch-wasm
labels
Jan 29, 2024
Tagging subscribers to 'arch-wasm': @lewing Issue Detailsnull
|
pavelsavara
force-pushed
the
browser_mt_emscripten_dispatch
branch
2 times, most recently
from
January 30, 2024 18:37
ef0ff17
to
0d4b99f
Compare
This was referenced Jan 30, 2024
pavelsavara
force-pushed
the
browser_mt_emscripten_dispatch
branch
from
January 31, 2024 08:07
0d4b99f
to
cd460db
Compare
This was referenced Jan 31, 2024
This comment was marked as resolved.
This comment was marked as resolved.
/azp run runtime-wasm |
Azure Pipelines successfully started running 1 pipeline(s). |
pavelsavara
force-pushed
the
browser_mt_emscripten_dispatch
branch
from
February 1, 2024 14:26
98d8cf5
to
e4ec20a
Compare
pavelsavara
force-pushed
the
browser_mt_emscripten_dispatch
branch
from
February 2, 2024 18:35
e4ec20a
to
7b1df18
Compare
/azp run runtime-wasm |
Azure Pipelines successfully started running 1 pipeline(s). |
pavelsavara
requested review from
lewing,
lambdageek and
vargaz
as code owners
February 2, 2024 19:26
31 tasks
maraf
reviewed
Feb 5, 2024
...rvices.JavaScript/src/System/Runtime/InteropServices/JavaScript/Interop/JavaScriptExports.cs
Show resolved
Hide resolved
...e.InteropServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/JSProxyContext.cs
Show resolved
Hide resolved
...ervices.JavaScript/src/System/Runtime/InteropServices/JavaScript/JSSynchronizationContext.cs
Outdated
Show resolved
Hide resolved
...ervices.JavaScript/src/System/Runtime/InteropServices/JavaScript/JSSynchronizationContext.cs
Outdated
Show resolved
Hide resolved
…stem/Runtime/InteropServices/JavaScript/JSSynchronizationContext.cs Co-authored-by: Marek Fišera <[email protected]>
…stem/Runtime/InteropServices/JavaScript/JSSynchronizationContext.cs Co-authored-by: Marek Fišera <[email protected]>
Co-authored-by: Marek Fišera <[email protected]>
…avelsavara/runtime into browser_mt_emscripten_dispatch
/azp run runtime-wasm |
Azure Pipelines successfully started running 1 pipeline(s). |
maraf
approved these changes
Feb 5, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me 👍
I filled #97968 |
This was referenced Feb 5, 2024
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
arch-wasm
WebAssembly architecture
area-System.Runtime.InteropServices.JavaScript
os-browser
Browser variant of arch-wasm
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Dispatch
use emscripten job queue in the target thread instead of
JSSynchronizationContext
to call cross-thread JS functions.This has following benefits
JSSynchronizationContext
schedule_background_exec
->setTimeout
tickCross-thread asynchronous
All of them are fire-and-forget messages
ReleaseCSOwnedObjectPost
InvokeJSImportAsyncPost
ResolveOrRejectPromisePost
&CancelPromisePost
Cross-thread synchronous
InvokeJSFunctionSend
&InvokeJSImportSyncSend
mono_coop_sem_wait
.Wait
for too longJSSynchronizationContext.Send
now throws PNSE on JS threads viaThrowOnBlockingWaitOnJSInteropThread
ConsolePal.Clear
- ICAL instead ofJSImport
- more in line the rest of with posix console pal.Other