title: Writing to the console using Task.Run() fails
body: <p>A colleague of mine found an issue with our code and it took a while to hunt down exactly what was happening, but it can be best demonstrated by this simple example:</p>
  
  <pre><code>// Fails
  class Program
  {
      static void Main(string[] args)
      {
          Task.Run(() =&gt; Console.WriteLine("Hello World"));
          Console.ReadKey();
      }
  }
  
  // Works fine
  class Program
  {
      static void Main(string[] args)
      {
          Console.Write(String.Empty);
          Task.Run(() =&gt; Console.WriteLine("Hello World"));
          Console.ReadKey();
      }
  }
  </code></pre>
  
  <p>It’s clear from playing around with this that writing to the console anywhere from the main thread will allow the background thread to write to the console also, but we are struggling to understand why this is happening.  Can anyone explain what writing to the console from the main thread achieves that the first snippet does not?</p>