-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[browser][MT] GC, threadpool and some JS interop improvements #86759
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
Merged
Conversation
This file contains hidden or 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
|
Tagging subscribers to 'arch-wasm': @lewing Issue Detailswork in progress
|
d6d63df to
114268b
Compare
Member
Author
|
/azp run runtime-wasm |
|
Azure Pipelines successfully started running 1 pipeline(s). |
pavelsavara
commented
May 31, 2023
pavelsavara
commented
May 31, 2023
This comment was marked as resolved.
This comment was marked as resolved.
lambdageek
reviewed
May 31, 2023
This comment was marked as resolved.
This comment was marked as resolved.
kg
reviewed
Jun 2, 2023
...ervices.JavaScript/src/System/Runtime/InteropServices/JavaScript/JSSynchronizationContext.cs
Outdated
Show resolved
Hide resolved
kg
reviewed
Jun 2, 2023
...ervices.JavaScript/src/System/Runtime/InteropServices/JavaScript/JSSynchronizationContext.cs
Outdated
Show resolved
Hide resolved
Member
Author
|
/azp run runtime-wasm |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Member
Author
Member
Author
|
/azp run runtime-wasm |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Member
Author
|
/azp run runtime-wasm |
|
Azure Pipelines successfully started running 1 pipeline(s). |
This was referenced Jun 9, 2023
Member
Author
|
/azp run runtime-wasm |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Member
Author
|
/azp run runtime-wasm |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Member
Author
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.
This makes GC, threadpool and some JS interop scenarios work on the mini sample
Changes
JSSynchronizationContext- could be installed on multiple threadsInstallWebWorkerInteropandUninstallWebWorkerInteropJSSynchronizationContextis automatically installed on the main threadmono_target_thread_schedule_background_jobhelps to implement thatexternal_eventloopandthread_idprivate fields ofThreadare accessed via reflection. I don't know about better way right now.System.Runtime.InteropServices.JavaScript.WebWorkerfor starting threads dedicated to JS interopRunmethod accepts synchronousAction.RunAsyncacceptsFunc<Task>and enables JS interop as well as async JSImport/JSExport.JSHost.ImportAsyncWebWorkeris un-managed resourceforceDisposeProxieswhich is called at the end ofWebWorkerrunFixes & tests
MONO_ENTER_GC_UNSAFE/MONO_EXIT_GC_UNSAFEintolifo-semaphore.ccallbacksMONO_ENTER_GC_UNSAFE/MONO_EXIT_GC_UNSAFEintomono_wasm_invoke_method_boundmono_threads_wasm_on_thread_detachedcallback for easier tracking of web workersset_thread_infowhich creates functionglobalThis.monoThreadInfoon the worker. It's easy to look at in the browser dev tools. Just in debug build of the runtime.Module.safeSetTimeoutfor jobsbrowser-threads-minimalSystemNative_GetCpuUtilizationNext
WebWorkerAPI is just early sketch. Do we want to make itIDisposableinstance instead ?WebWorker.Run, maybe with a flag parameterforceDisposeProxies