Work Thread in Debugger
HI
I have created a really simple console app. When i run it on visual studio, it shows only one main thread. When i run in rider(2021) in mac os, the Parallel stacks should only main thread as well, which is matched with visual studio. But when i click the Debugger window, it shows two extra Worker threads, so just wondering what is the Worker thread doing ?



Please sign in to leave a comment.
Hi,
The Worker threads are utilised by CLR (dotnet runtime) for internal purposes.
In your case, I suppose that the first worker thread is the finaliser thread (https://devblogs.microsoft.com/dotnet/finalization-implementation-details/) utilised by GC infrastructure to call finaliser methods. Other threads are most likely owned by dotnet ThreadPool (https://docs.microsoft.com/en-us/dotnet/standard/threading/the-managed-thread-pool). CLR creates them by default, but ThreadPool can grow over time and number of worker threads can be increased