2

Possible Duplicate:
Why 3 threads for a basic single threaded c# console app?

Steps:

  1. Created a Console Application (c#) in .net.
  2. Wrote the below 3-4 lines of code in Program.cs

    class Program {

        static void Main(string[] args)
        {
            HelloWorkd();
            Console.Read();
        }
        static void HelloWorkd()
        {
           Console.WriteLine("Hello World");
        }
    

    }

  3. Build the project, in debug mode.

  4. Browsed to the .exe that is generated and start it.
  5. Started Task Manager, and had a look the process in which this exe is running. And it shows that 3 thread are running in this application!!!

Question: How come a simple program is showing three threads? I can accept 2 threads here, one for GC and other for my console, what is the third thread doing?

Thanks for your interest.

Community
  • 1
  • 1
Manish Basantani
  • 16,931
  • 22
  • 71
  • 103
  • 2
    Duplicate of [Why 3 threads for a basic single threaded c# console app?](http://stackoverflow.com/questions/762316/why-3-threads-for-a-basic-single-threaded-c-console-app) – Shog9 Mar 12 '11 at 18:21
  • 1
    Got the answer in the duplicate thread. Thanks. – Manish Basantani Mar 12 '11 at 18:32

0 Answers0