title: Background Threads in C#
body: <p>I am new to C#.I learnt that normally all threads are foreground until unless you explicitly specify it as "background" thread using <i> IsBackGround= true  </i>.</p>
  
  <p>Some doubts popped in to my mind.</p>
  
  <p>1) What is the advantage of keeping a thread as background thread?</p>
  
  <p>2) When  executing  the folowing code :</p>
  
  <pre><code>    static void Main(string[] args)
      {
          Thread worker = new Thread(SayHello);
          worker.IsBackground = true;
          worker.Start();
          Console.WriteLine("Hello From Main");
      }
  
      static void SayHello()
      {
          Console.WriteLine("Hello World");
          Console.ReadKey(true);
      } 
  </code></pre>
  
  <p>i need to use worker.Join() to keep the main thread to wait as the program terminates immediately. Apart from Join() could i use other techniques to keep the main thread wait ?</p>