This repository has been archived by the owner on Nov 1, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 509
Main thread Thread::WaitForGC infinitely #8308
Comments
@jkotas So this GC suspension hanging bug still exists in current CoreRT? |
Yes, this problem still exists in current CoreRT. |
Got it. Thanks for reply. |
I managed to make this game demo works in .NET Native in UWP before. |
.NET Native has the codegen+runtime feature necessary for the GC to be able to make progress in a case like this. CoreRT has a different codegen so this requires extra work that hasn't happened yet. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I had a demo MonoGame 3.8 game project and try CoreRT with it.
The game use two thread loops, one is a background thread for sending draw commands to a ConcurrentQueue, another is the game loop in main thread that receive draw commands from ConcurrentQueue and draw the game.
After compiled with CoreRT and run, the window just freezed and nothing was showed. Then I debug it with vscode and it seems the Main thread stuck on
Thread::WaitForGC
, sometimes stuck onThreadStore::WaitForSuspendComplete
.I've noticed that the background thread, which is
MirGameTemplate.WindowsDX.exe!MirEngine_MirEngine_GameBase__ActiveSceneDrawLoop()
in the following stack trace, is not suspended and is running in a intential inifinite loop. If I put aThread.Sleep(1)
in this loop then everything is working.Here is a stack trace of threads:
Main Thread
MirGameTemplate.Windows.DX.exe!FinalizerStart
MirGameTemplate.WindowsDX.exe!S_P_CoreLib_System_Threading_Thread_ThreadEntryPoint
*MirGameTemplate.WindowsDX.exe!unsigned int (void )::<lambda_invoker_cdecl>
MirGameTemplate.WindowsDX.exe!S_P_CoreLib_System_Threading_Thread_ThreadEntryPoint
The text was updated successfully, but these errors were encountered: