title: Difference between Thread, ThreadPool & BackgroundWorker
body: <p>i many time call method with the help of thread like</p>
  
  <pre><code>static void Main( string[] args )
  {
      Thread t = new Thread( MyFunction );
      t.Start();
  }
  
  static void MyFunction()
  {
      //code goes here
  }
  </code></pre>
  
  <p>and some time i use <code>ThreadPool</code> class also like</p>
  
  <pre><code>System.Threading.ThreadPool.QueueUserWorkItem(delegate {
      MyFunction();
  }, null);
  </code></pre>
  
  <p>but i do not understand what is the difference between calling any method with the help of thread class or <code>ThreadPool</code> class</p>
  
  <p>so i am looking a good discussion about what is the difference between Thread &amp; <code>ThreadPool</code> class.also need to know when we should use Thread class to call a method and when <code>ThreadPool</code> class to call any method ? if possible discuss also with sample code with sample situation.</p>
  
  <p>another very important question is that if i start multiple thread then my application performance will become low or bad ? if yes then tell me why...?</p>
  
  <p>now also tell me what is <code>BackgroundWorker</code> class and how it is different from Thread &amp; <code>ThreadPool</code> class. how far i heard that <code>BackgroundWorker</code> class also create a separate thread to run any method. so please discuss how it is different from Thread &amp; <code>ThreadPool</code> class and when one should go for <code>BackgroundWorker</code> class.</p>
  
  <p>here is small sample code of <code>BackgroundWorker</code></p>
  
  <pre><code>private void button1_Click(object sender, EventArgs e)
      {
          BackgroundWorker bw = new BackgroundWorker();
  
          // this allows our worker to report progress during work
          bw.WorkerReportsProgress = true;
  
          // what to do in the background thread
          bw.DoWork += new DoWorkEventHandler(
          delegate(object o, DoWorkEventArgs args)
          {
              BackgroundWorker b = o as BackgroundWorker;
  
              // do some simple processing for 10 seconds
              for (int i = 1; i &lt;= 10; i++)
              {
                  // report the progress in percent
                  b.ReportProgress(i * 10);
                  Thread.Sleep(1000);
              }
  
          });
  
          // what to do when progress changed (update the progress bar for example)
          bw.ProgressChanged += new ProgressChangedEventHandler(
          delegate(object o, ProgressChangedEventArgs args)
          {
              label1.Text = string.Format("{0}% Completed", args.ProgressPercentage);
          });
  
          // what to do when worker completes its task (notify the user)
          bw.RunWorkerCompleted += new RunWorkerCompletedEventHandler(
          delegate(object o, RunWorkerCompletedEventArgs args)
          {
              label1.Text = "Finished!";
          });
  
          bw.RunWorkerAsync();
      }
  </code></pre>