title: Why use C# async/await for CPU-bound tasks
body: <p>I'm getting the hang of the async/await keywords in C#, and how they facilitate asynchronous programming - allowing the the thread to be used elsewhere whilst some I/O bound task like a db call is going on.</p>
  
  <p>I have read numerous times that async/await is for I/O bound tasks, not CPU-bound tasks. CPU-bound tasks should be performed on a separate background thread. Mentioned several times in these <a href="https://channel9.msdn.com/Series/Three-Essential-Tips-for-Async" rel="noreferrer">videos</a>. All ok.</p>
  
  <p>However, when starting long-running CPU-bound work on a new thread using <code>Task.Run</code>, you then have to <code>await</code> it at some point. So aren't we using async/await here for a CPU-bound task too? See example below.</p>
  
  <pre><code>public async Task SomeMethodAsync()
  {
      int result = await Task.Run(() =&gt;
      {
          // Do lots of CPU bound calculations...
  
          return result;
      }
  
      // Then do something with the result.
  }
  </code></pre>