Skip to content
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] pre-load threads early in dotnet.js #98637

Merged
merged 7 commits into from
Feb 19, 2024

Conversation

pavelsavara
Copy link
Member

@pavelsavara pavelsavara commented Feb 18, 2024

  • pre-load threads early in dotnet.js
    • they are merged into emscripten pool in new populateEmscriptenPool
  • introduce new workerNumber sequence
    • send monoThreadInfo from UI to worker together with config
  • introduce pthreadPoolReady config as floating pool and keep pthreadPoolSize as pre-init pool. See getNewWorker
  • moved mono_wasm_init_diagnostics bit later, when thread pool is ready, but before mono start
  • moved init_finalizer_thread even later, 200ms after runtime is ready. This may improve GC deadlock
  • refactor how we handle emscripten internals, separated UI and workers
  • move thread typescript types to types\internal.ts

@pavelsavara pavelsavara added arch-wasm WebAssembly architecture area-System.Runtime.InteropServices.JavaScript os-browser Browser variant of arch-wasm labels Feb 18, 2024
@pavelsavara pavelsavara added this to the 9.0.0 milestone Feb 18, 2024
@ghost
Copy link

ghost commented Feb 18, 2024

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details
  • pre-load threads early in dotnet.js
  • refactor how we handle emscripten internals
  • move thread typescript types
Author: pavelsavara
Assignees: -
Labels:

arch-wasm, area-System.Runtime.InteropServices.JavaScript, os-browser

Milestone: 9.0.0

@ghost ghost assigned pavelsavara Feb 18, 2024
@pavelsavara pavelsavara marked this pull request as ready for review February 19, 2024 09:06
src/mono/browser/runtime/diagnostics/index.ts Show resolved Hide resolved
src/mono/browser/runtime/exports.ts Outdated Show resolved Hide resolved
src/mono/browser/runtime/loader/assets.ts Outdated Show resolved Hide resolved
src/mono/browser/runtime/loader/config.ts Show resolved Hide resolved
src/mono/browser/runtime/pthreads/browser/index.ts Outdated Show resolved Hide resolved
src/mono/browser/runtime/pthreads/browser/index.ts Outdated Show resolved Hide resolved
src/mono/browser/runtime/types/index.ts Outdated Show resolved Hide resolved
src/mono/browser/runtime/types/index.ts Outdated Show resolved Hide resolved
@pavelsavara
Copy link
Member Author

/azp run runtime-wasm

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@pavelsavara
Copy link
Member Author

/azp run runtime-wasm

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@pavelsavara pavelsavara merged commit ae4c05a into dotnet:main Feb 19, 2024
53 checks passed
@pavelsavara pavelsavara deleted the browser_threads_earlier branch February 19, 2024 14:42
@github-actions github-actions bot locked and limited conversation to collaborators Mar 21, 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants