-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[browser] threads & js cleanup #86278
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
Conversation
|
Tagging subscribers to 'arch-wasm': @lewing Issue Detailsnull
|
|
/azp run runtime-wasm |
|
Azure Pipelines successfully started running 1 pipeline(s). |
126ce7b to
85c2276
Compare
|
/azp run runtime-wasm |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run runtime-wasm |
|
Azure Pipelines successfully started running 1 pipeline(s). |
eaebbbc to
43f6941
Compare
|
/azp run runtime-wasm |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
AOT issues are #86621 |
|
/azp run runtime-wasm |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run runtime-wasm |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
CI failures are unrelated |
ilonatommy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After discussing offline: LGTM.
ilonatommy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After discussing offline: LGTM.
|
@lambdageek or @kg please have yet another look and approve. I think the only part which needs your attention is change from invoke via mono reflection to invoke via |
lambdageek
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly LGTM. A couple of nits.
Two things to consider addressing:
- The
_DataIsAvailabledelegate is there to avoid allocating a new delegate object each time - The 25s delay is testing the threadpool worker timeout doesn't kill a worker that has unsettled promise. Changing to 5s changes the test.
...ervices.JavaScript/src/System/Runtime/InteropServices/JavaScript/JSSynchronizationContext.cs
Show resolved
Hide resolved
...ervices.JavaScript/src/System/Runtime/InteropServices/JavaScript/JSSynchronizationContext.cs
Outdated
Show resolved
Hide resolved
src/mono/System.Private.CoreLib/src/System/Threading/ThreadPool.Browser.Mono.cs
Show resolved
Hide resolved
src/mono/System.Private.CoreLib/src/System/Threading/ThreadPool.Browser.Mono.cs
Outdated
Show resolved
Hide resolved
src/mono/System.Private.CoreLib/src/System/Threading/ThreadPool.Browser.Mono.cs
Outdated
Show resolved
Hide resolved
| [DynamicDependency("Callback")] | ||
| [MethodImplAttribute(MethodImplOptions.InternalCall)] | ||
| private static extern void QueueCallback(); | ||
| internal static extern unsafe void MainThreadScheduleBackgroundJob(void* callback); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: It would be nice to collect all of these internal calls that are called inside S.P.C into a single class
src/mono/System.Private.CoreLib/src/System/Threading/TimerQueue.Browser.Mono.cs
Outdated
Show resolved
Hide resolved
src/mono/System.Private.CoreLib/src/System/Threading/TimerQueue.Browser.Mono.cs
Outdated
Show resolved
Hide resolved
added comments added missing export of _emscripten_main_runtime_thread_id
|
/azp run runtime-wasm |
|
Azure Pipelines successfully started running 1 pipeline(s). |
...ervices.JavaScript/src/System/Runtime/InteropServices/JavaScript/JSSynchronizationContext.cs
Outdated
Show resolved
Hide resolved
add asserts and exception handlers
|
/azp run runtime-wasm |
|
Azure Pipelines successfully started running 1 pipeline(s). |
I'm not sure that invoking via UnmanagedCallersOnly will transition from one GC mode to another correctly. @lambdageek do you know? |
It will work correctly (unless you use |
# Conflicts: # src/mono/wasm/wasm.proj
This is just cleanup. There are no intended functional changes.
TimerQueue
SetTimeouttoMainThreadScheduleTimerReplaceNextSetTimeouttoReplaceNextTimerTimeoutCallbacktoTimerHandlermono_wasm_set_timeouttomono_wasm_main_thread_schedule_timermono_set_timeout_exectomono_wasm_execute_timer[UnmanagedCallersOnly]instead ofmono_runtime_try_invokeThreadPool
QueueCallbacktoMainThreadScheduleBackgroundJobusingmono_main_thread_schedule_background_jobCallbacktoBackgroundJobHandler[UnmanagedCallersOnly]instead ofmono_runtime_try_invokeJSSynchronizationContext
RequestPumpCallbackScheduleBackgroundJobtoMainThreadScheduleBackgroundJobusingmono_main_thread_schedule_background_jobJobs
mono_threads_schedule_background_jobintomono_current_thread_schedule_background_jobandmono_main_thread_schedule_background_jobMT Debugger
bind_static_method.Other
install_sync_contextbrowser-threads-minimalto pass on Windowsmono_threads_wasm_async_run_in_target_threadmono_bound_thread_schedule_background_jobin preparation for next stepconv_stringto different file_get_class_name,_get_type_name,_get_type_aqnmethodsmono_wasm_bind_cs_functionandmono_wasm_bind_js_functiononly under Debug build of the runtime. It makes debugging easier because names the exported/imported function are visible on the stack trace.normalizeConfigafter it arrived by message.