title: Deep understanding of async / await on ASP.NET MVC
body: <p>I don't understand exactly what is going on behind the scenes when I have an async action on an MVC controller especially when dealing with I/O operations. Let's say I have an upload action:</p>
  
  <pre><code>public async Task&lt;ActionResult&gt; Upload (HttpPostedFileBase file) {
    ....
    await ReadFile(file);
  
    ...
  }
  </code></pre>
  
  <p>From what I know these are the basic steps that happen:</p>
  
  <ol>
  <li><p>A new thread is peeked from threadpool and assigned to handle incomming request.</p></li>
  <li><p>When await gets hit, if the call is an I/O operation then the original thread gets back into pool and the control is transfered to a so-called IOCP (Input output completion port). What I do not understand is why the request is still alive and waits for an answer because in the end the calling client will wait for our request to complete.</p></li>
  </ol>
  
  <p>My question is: Who / when / how does this wait for complete blocking occurs?</p>
  
  <p>Note: I saw the blog post <em><a href="http://blog.stephencleary.com/2013/11/there-is-no-thread.html">There Is No Thread</a></em>, and it makes sense for GUI applications, but for this server side scenario I don't get it. Really.</p>