-
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] merge wasm-threading-eventpipe into main #68232
[mono] merge wasm-threading-eventpipe into main #68232
Conversation
Co-authored-by: Zoltan Varga <vargaz@gmail.com>
Environment setting https://github.com/emscripten-core/emscripten/blob/2.0.34/src/settings.js#L616-L641 From emscripten 2.0.25 release notes - Support for the 'shell' environment is now disabled by default. Running under `d8`, `js`, or `jsc` is not something that most emscripten users ever want to do, so including the support code is, more often than not, unnecessary. Users who want shell support can enable it by including 'shell' in `-s ENVIRONMENT` (dotnet#14535). Example of the the size increase for bench sample: -a--- 12/10/2021 3:35 PM 382113 dotnet.js -a--- 12/13/2021 10:37 AM 383589 dotnet.js
To enable, pass `/p:WasmEnableThreads` when building the runtime ./build.sh -Subset mono+libs -os Browser -arch wasm /p:WasmEnableThreads=true
… that worker initialization can find dotnet.js
…roperly get a Module instance, since we broke the API
fixes aot compilation
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.
Great job putting this together!
/azp run runtime-wasm |
Azure Pipelines successfully started running 1 pipeline(s). |
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.
Infrastructure changes LGTM. Good work 👍
/azp run runtime-wasm |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run runtime-wasm |
Azure Pipelines successfully started running 1 pipeline(s). |
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.
LGTM!
@@ -10,9 +10,9 @@ if(ENABLE_PERFTRACING) | |||
add_definitions(-DENABLE_PERFTRACING_PAL_TCP) | |||
endif (FEATURE_PERFTRACING_PAL_TCP) | |||
|
|||
if (FEATURE_PERFTRACING_DISABLE_LISTEN_PORTS) |
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.
Why was this needed?
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.
this is a fix for a typo, the old cmake variable name was unused
|
||
## Building ## | ||
|
||
Build with `/p:WasmEnableThreads=true` to enable support for multi-threading. |
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.
Will this also enable EventPipe diagnostics support?
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.
I think so. Once we have full user-visible multithreading there's no particular reason to exclude eventpipe.
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.
LGTM thank you! Found just one small formatting nit.
#endif | ||
#endif | ||
|
||
internal static void ThrowIfNoThreadStart() { |
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.
nit: formatting: curly brace on new line
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.
🎊 |
Merge initial work on multi-threaded WebAssembly.
The normal wasm build is single-threaded. There should be no functional changes to its behavior.
To enable a multi-threaded build pass
/p:WasmEnableThreads=true
. Seesrc/mono/wasm/threads.md
for details.The big changes are:
[UnsupportedOSPlatform("browser")]
attributes for various threading-related functions[UnsupportedOSPlatform]
attributes are removed, and functions that used to always throw PNSE nwo do a runtime check usingSystem.Threading.Thread.IsThreadStartSupported
to check if threading is enabled in the current build.Microsoft.NET.WebAssembly.Threading
is created. It contains experimental ref assemblies without the[UnsupportedOSPlatform]
attributes. The intention is that code opting into experimenting with multithreading will include this nuget by setting some property that will be used by the wasm MSBuild SDK to pick a multi-threaded runtime build and configure things appropriately. (The SDK updates don't exist yet).Remaining work is tracked in the related issue #68162