Uh oh!
There was an error while loading. Please reload this page.
[browser][MT] JSImport dispatch to target thread via JSSynchronizationContext - #96319
Conversation
ghost
commented
Dec 26, 2023
Tagging subscribers to 'arch-wasm': @lewing Issue DetailsJSImport dispatch
Tests
Other
|
pavelsavara
commented
Dec 26, 2023
/azp run runtime-wasm |
|
Azure Pipelines successfully started running 1 pipeline(s). |
pavelsavara
commented
Dec 27, 2023
/azp run runtime-wasm |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Uh oh!
There was an error while loading. Please reload this page.
pavelsavara
commented
Dec 30, 2023
/azp run runtime-wasm |
Uh oh!
There was an error while loading. Please reload this page.
| [MethodImpl(MethodImplOptions.AggressiveInlining)] | ||
| internal static unsafe void ResolveOrRejectPromise(JSProxyContext targetContext, Span<JSMarshalerArgument> arguments) | ||
| { | ||
| // this copy is freed in mono_wasm_invoke_import_async |
There was a problem hiding this comment.
this used to be always synchronous, and now becomes always-asynchronous. should we preserve the old synchronous execution when the target context is the current context?
There was a problem hiding this comment.
I think that JS Promise handlers always go through microtask queue. So in effect this was already async before from user code perspective. We could avoid allocating C# queue item if we do the optimization you suggest.
I want to switch this to emscripten dispatch later anyway. I will add comment and keep this open question for now.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
kg
left a comment
There was a problem hiding this comment.
other than my comments this all looks good to me, and i feel like i understand most of it
pavelsavara
commented
Jan 3, 2024
/azp run runtime-wasm |
|
Azure Pipelines successfully started running 1 pipeline(s). |
JSImport dispatch
JSImportwill now dispatch the call to the correct threadJSObjectpassed as parametersJSWebWorkerTask/PromiseTask/PromiseresultJSImportGeneratordoesn't generateThreadStaticanymore for the binding variableTests
System.Runtime.InteropServices.JavaScript.Tests.WebWorkerTest, more to come laterSystem.Runtime.InteropServices.JavaScript.Testsnow also run xunit on thread pool in MTOther
AssertIsInteropThreadJSFunctionBinding.FunctionNameonly in Debug buildJSWebWorkermono_set_thread_idimproves TID in JS console logging from threadsmono_wasm_main_thread_ptrworker.pthread_ptrFollow up in #95370