-
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
[wasm-mt] Fixup C exports initialization after startup.ts refactoring #73158
Merged
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
lambdageek
requested review from
lewing,
pavelsavara and
lateralusX
as code owners
August 1, 2022 15:19
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
ghost
assigned lambdageek
Aug 1, 2022
Tagging subscribers to 'arch-wasm': @lewing Issue DetailsFixup issues due to d7c8bc1:
|
lambdageek
commented
Aug 1, 2022
pavelsavara
reviewed
Aug 1, 2022
pavelsavara
approved these changes
Aug 1, 2022
/azp run runtime-wasm |
Azure Pipelines successfully started running 1 pipeline(s). |
lambdageek
force-pushed
the
wasm-mt-pthread-cwraps
branch
2 times, most recently
from
August 2, 2022 01:51
623a0bd
to
1acad8d
Compare
/azp run runtime-wasm |
Azure Pipelines successfully started running 1 pipeline(s). |
1. Copy the mono_wasm_pre_init_essential code into mono_wasm_pthread_worker_init in order to set up the C bindings infrastructure in the workers. 2. Because `mono_wasm_pthread_worker_init` runs in the middle of Emscripten's initialization (before all the Emscripten properties on `Module` are assigned) always use lazy cwraps initialization (the issue is `Module["cwrap"]` hasn't been set yet)
lambdageek
force-pushed
the
wasm-mt-pthread-cwraps
branch
from
August 2, 2022 02:31
1acad8d
to
23a6031
Compare
This comment was marked as outdated.
This comment was marked as outdated.
oops, I meant to do that to my other PR. this one is ok. |
ghost
locked as resolved and limited conversation to collaborators
Sep 1, 2022
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Fixup issues due to d7c8bc1:
init_c_exports
lazily on pthread workers, always. Eager initialization doesn't work because at the time that our code runs, Emscripten hasn't fully initializedModule
yet (in particularModule["cwraps"]
hasn't been assigned yet).mono_wasm_pthread_worker_init
directly frominitializeImportsAndExports
- calling it frompreInit
doesn't work because Emscripten doesn't runpreInit
in pthread workers. Also there's a technical change here to return aPromise<EmscriptenModule>
- Emscripten is good with this because they use.then
inworker.js
and it's good for us because we can do async initialization at this point (for example waiting for the channel to the main browser thread to get established)