Concurrent GC fails to run concurrently #13238
Labels
area-GC-coreclr
question
Answer questions and provide assistance, not an issue with source code or documentation.
Milestone
I'm seeing an occasional issue on netcore 2.2 where a concurrent Gen2 GC seems to not run on the background GC thread, instead running on the thread that triggered the collection.
This was observed on my Windows 10 development running an app in Release configuration on the 64-bit .NET Core 2.2 runtime with the default GC profile (workstation, concurrent GC enabled, interactive latency mode), and I was able to grab a perfview sample of the occurence:
Looking through the GC source, I think there may be an issue introduced in this commit. Before the change,
bgc_thread
would be set at the time of thread creation, and would be guaranteed to be set by the time it's checked invoid gc_heap::garbage_collect (int n)
. After the change,bgc_thread
is now set within the new thread at the start of it's execution, which seems like it would introduce a race condition where that field may not be set in time for concurrent GC to continue.The text was updated successfully, but these errors were encountered: