title: Throwing methods into a Task to avoid blocking the asp.net thread
body: <p>I'm wondering if the following code has any gotcha's that I'm not aware of when running on a webserver. Reading through the excellent series <a href="http://reedcopsey.com/series/parallelism-in-net4/" rel="noreferrer">http://reedcopsey.com/series/parallelism-in-net4/</a> I am unable to find anything that relates specifically to my question, same with the msdn, so I thought I'd bring it here.</p>
  
  <p>Example call:</p>
  
  <pre><code>public ActionResult Index() {
      ViewBag.Message = "Welcome to ASP.NET MVC!";
  
      Task.Factory.StartNew(() =&gt; {
          //This is some long completing task that I don't care about
          //Say logging to the database or updating certain information
          System.Threading.Thread.Sleep(10000);
      });
  
      return View();
  }
  </code></pre>