title: await keyword blocks main thread
body: <p>So I have the following code</p>
  
  <pre><code>private async void button1_Click(object sender, EventArgs e)
  {
      await DoSomethingAsync();
  
      MessageBox.Show("Test");
  }
  
  private async Task DoSomethingAsync()
  {
      for (int i = 0; i &lt; 1000000000; i++)
      {
          int a = 5;
      }; // simulate job
  
      MessageBox.Show("DoSomethingAsync is done");
  
      await DoSomething2Async();
  }
  
  private async Task DoSomething2Async()
  {
      for (int i = 0; i &lt; 1000000000; i++)
      {
          int a = 5;
      } // simulate job
  
      MessageBox.Show("DoSomething2Async is done");
  }
  </code></pre>
  
  <p>Until both MessageBoxes are shown the main thread is block (I mean the application itself is frozen). There is obviously something wrong with my code and I can't figure out what. I've never used async/await before. this is my first attempt.</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Actually what i want to do is to start Execution of <code>DoSomethingAsync</code> asynchronously so that when button is clicked the <code>MessageBox.Show("Test");</code> would execute even though the DoSomethingAsync is incomplete.</p>