Reputation: 753
I'm creating a very simple WinForm app in C#. With nothing but the form. No other code. When I hit pause and look at the threads window in Visual Studio, i see 3 threads. 1 main thread and 2 worker threads (used for may be GC or JIT)
When I open Task Manager when application is running then I see 14-16 threads for the application. I don't understand what is creating these other threads. Can anyone help?
Upvotes: 2
Views: 294
Reputation: 6361
Additional worker threads could be there for any number of reasons in a WinForms app, including:
It's likely that most of the threads you're seeing are the first kind.
Tip: If you want to see these threads in the Visual Studio debugger's Threads panel, make sure your project is configured to "Enable native code debugging" (under the Debug tab in Project Settings).
Upvotes: 2