-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Closed
Labels
arch-wasmWebAssembly architectureWebAssembly architecturearea-Hostos-browserBrowser variant of arch-wasmBrowser variant of arch-wasm
Milestone
Description
It would unlock following features that depend on yielding to browser event loop
- Threadpool
- GC Finalizer
- Timers
- HTTP & WS clients
implementation notes
- make
BrowserHost_ExecuteAssemblyto yield ICLRRuntimeHost4->ExecuteAssembly(domainId, managedAssemblyPathW, argc, argvW, (DWORD *)exitCode)src\coreclr\vm\corhost.cpp-CorHost2::ExecuteAssemblysrc\coreclr\vm\assembly.cpp-Assembly::ExecuteMainMethodRunMain->ValidateMainMethod,RunMainInternalSystemJS_ScheduleBackgroundJob
public static void MainWrapper(string[] args, Func<string[], Task<int>> original, Action<int> resolve, Action<string> reject)
{
var task = original(args);
task.ContinueWith(t =>
{
if (t.IsFaulted)
{
reject(t.Exception.Message);
}
else
{
resolve(t.Result);
}
}, TaskScheduler.Default);
}Line 208 in 3149da8
| public static unsafe Task<int>? CallEntrypoint(IntPtr assemblyNamePtr, string?[]? args, bool waitForDebugger) |
| void SystemInteropJS_AssemblyGetEntryPoint (char *assembly_name, int auto_insert_breakpoint, MonoMethod **method_out) |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
arch-wasmWebAssembly architectureWebAssembly architecturearea-Hostos-browserBrowser variant of arch-wasmBrowser variant of arch-wasm
Type
Projects
Status
No status