You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice to move those macros into mono_gc_init_finalizer_thread (). However, we aren't sure how much it will break. I'll leave it up to @lambdageek.
To be clear, mono_gc_init_finalizer_thread cannot avoid entering GC-Safe mode - it creates a thread object on the managed heap.
@thaystg Could you discuss the MONO_ENTER_GC_SAFE_UNBALANCED; line in #16907 ? Is it a necessary fix for a certain embedded configuration? If that line is not necessary, we can remove all of this.
OKay, the reason why I changed this is because sometimes with embedded mono we can call mono_jit_init_version or mono_jit_init and doesn't start the execution of a managed code yet, and then we try to suspend the vm to run the GC, in this case we got a hang.
To fix this what I tried to do is, enable MONO_ENTER_GC_SAFE_UNBALANCED when it runs mono_jit_init, so we don't need to care about this thread because it's not executing a managed code, until we run mono_runtime_invoke or mono_runtime_invoke that will run a MONO_ENTER_GC_UNSAFE_BALANCED and then it will be needed to stop when we run the GC.
I think that we can move the MONO_ENTER_GC_UNSAFE and MONO_EXIT_GC_UNSAFE inside the mono_gc_init_finalizer_thread, mono_gc_init_finalizer_thread is an external only function and will be the same behavior that is already implemented by mono_runtime_invoke because both of them will call managed code.
Usages in our SDKs:
mono/sdks/ios/app/runtime.m
Lines 340 to 342 in 2709c81
It would be nice to move those macros into
mono_gc_init_finalizer_thread ()
. However, we aren't sure how much it will break. I'll leave it up to @lambdageek./cc @alexischr @akoeplinger
The text was updated successfully, but these errors were encountered: