title: Is async and await exclusively for GUI-based asynchronous programming?
body: <p>I've been reading about the new <code>async</code> and <code>await</code> operators in C# and tried to figure out in which circumstances they would possibly be useful to me. I studied several MSDN articles and here's what I read between the lines:</p>
  
  <p>You can use <code>async</code> for Windows Forms and WPF event handlers, so they can perform lengthy tasks without blocking the UI thread while the bulk of the operation is being executed.</p>
  
  <pre><code>async void button1_Click(object sender, EventArgs e)
  {
      // even though this call takes a while, the UI thread will not block
      // while it is executing, therefore allowing further event handlers to
      // be invoked.
      await SomeLengthyOperationAsync();
  }
  </code></pre>
  
  <p>A method using <code>await</code> must be <code>async</code>, which means that the usage of any <code>async</code> function somewhere in your code ultimately forces all methods in the calling sequence from the UI event handlers up until the lowest-level <code>async</code> method to be <code>async</code> as well.</p>
  
  <p>In other words, if you create a thread with an ordinary good old <code>ThreadStart</code> entry point (or a Console application with good old <code>static int Main(string[] args)</code>), then you cannot use <code>async</code> and <code>await</code> because at one point you would have to use <code>await</code>, and make the method that uses it <code>async</code>, and hence in the calling method you also have to use <code>await</code> and make that one <code>async</code> and so on. But once you reach the thread entry point (or <code>Main()</code>), there's no caller to which an <code>await</code> would yield control to.</p>
  
  <p>So basically you cannot use <code>async</code> and <code>await</code> without having a GUI that uses the standard WinForms and WPF message loop. I guess all that makes indeed sense, since MSDN states that <code>async</code> programming does not mean multithreading, but using the UI thread's spare time instead; when using a console application or a thread with a user defined entry point, multithreading would be necessary to perform asynchronous operations (if not using a compatible message loop).</p>
  
  <p>My question is, are these assumptions accurate?</p>