Number of threads in a .Net Application

  • Thread starter Thread starter Vijaye Raji
  • Start date Start date
V

Vijaye Raji

I create a test app in C# as below:

using System
namespace Test1
{
class Test2
{
static void Main()
{
Console.ReadLine();
}
}
}

When I compile and run this app, I see this "tiny" app, running 4 threads.
Accounting one for the garbage collector, what are the other two threads and
what are their functions?

-vJ
 
Hi Vijaye,

Even that little tiny application requires .NET runtime in order to work.
CLR is not as tiny as your sample and I'm not surprised that it runs 3
threads. On my machine the threads are three not four if it could be any
consolation :) .
 
1. Unmanaged thread used to load/run/unload the CLR .
2. Managed thread running Main() in a default domain.
3. Managed Finalizer thread.
4. Unmanaged Debugger thread (optional).

Willy.
 
Back
Top