title: backgroundworker halting on RunWorkerAssync
body: <p>I'm using a backgroundworker to run a separate thread, however it seems that my program is halting after the call to <code>RunWorkerAssync()</code>.</p>
  
  <p>Here's where I set everything up:</p>
  
  <pre><code>   BackgroundWorker worker = new BackgroundWorker();
     worker.WorkerSupportsCancellation = false;
     worker.WorkerReportsProgress = true;
     worker.DoWork += new DoWorkEventHandler(bw_DoWork);
     worker.ProgressChanged += new ProgressChangedEventHandler(bw_ProgressChanged);
     worker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bw_RunWorkerCompleted);
     worker.RunWorkerAsync();
     console.writeline("I'm Done!");
  </code></pre>
  
  <p>And here is my <code>bw_DoWork</code> function:</p>
  
  <pre><code>private void bw_DoWork(object sender, DoWorkEventArgs e)
      {
  
          System.Threading.Thread.Sleep(5000);
  
      }
  </code></pre>
  
  <p>And my <code>bw_RunWorkerCompleted</code> and <code>bw_ProgressChanged</code>:</p>
  
  <pre><code>private void bw_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
      {
          if ((e.Cancelled == true))
          {
  
          }
  
          else if (!(e.Error == null))
          {
  
          }
  
          else
          {
  
          }
      }
  
  private void bw_ProgressChanged(object sender, ProgressChangedEventArgs e)
      {
  
      }
  </code></pre>
  
  <p>The problem I am having is that sure enough, I don't get the console output until 5 seconds after it runs. When I change the sleep to a larger/shorter time, the wait for the console output adjusts accordingly. </p>
  
  <p>Isn't the point of using a background worker so that you can shove some task to a different thread while your program continues to execute? Or am I missing something?</p>
  
  <p>Thanks</p>