-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[coop-threading] Track concurrent state for synchronous calls #12123
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
base: main
Are you sure you want to change the base?
[coop-threading] Track concurrent state for synchronous calls #12123
Conversation
|
I've only skimmed this so far; it looks generally reasonable, but I expect it will conflict with #12153, which I'm about to split into smaller PRs per @alexcrichton's request. Given that the |
Threads are currently not created on sync->sync export calls, sync host->guest calls, and module-level start function calls. This PR adds support to this for all of these.
I added a component-model-async feature to wasmtime-environ so that sync->sync adapters are compiled as they were originally for wasip2 code, avoiding changing performance characteristics.
Rather than use the existing prepare_call + start_call machinery, I introduced sync_to_sync_enter/exit_call intrinsics to avoid adding additional host frames to the stack for sync calls.
Currently, doing operations that require thread state inside
post_returnfunctions is unsupported. If we're happy merging this as-is and creating an issue to resolve this later, we can do so, or I can try and address it prior to merging.Fixes #11954