We need to have "double" await so that GUI will not freeze?
<p>I expect my GUI will not hang, after reading <a href="http://msdn.microsoft.com/en-us/library/hh191443.aspx" rel="nofollow">Asynchronous Programming with Async and Await (C# and Visual Basic)</a></p>

<pre><code>    public async Task&lt;string&gt; DoBusyJob()
    {
        // Busy Job
        Thread.Sleep(10000);
        i++;
        return "Finished " + i;
    }

    int i = 0;

    private async void button1_Click(object sender, EventArgs e)
    {
        // Hang!
        string result = await DoBusyJob();

        this.label1.Text = result;
    }
</code></pre>

<p><strong>But, it is not. It still hang.</strong> I realize I need to add additional <code>await</code> in <code>DoBusyJob</code></p>

<pre><code>    public async Task&lt;string&gt; DoBusyJob()
    {
        // Busy Job
        await Thread.Sleep(10000);
        i++;
        return "Finished " + i;
    }

    int i = 0;

    private async void button1_Click(object sender, EventArgs e)
    {
        // OK!
        string result = await DoBusyJob();

        this.label1.Text = result;
    }
</code></pre>

<p>May I know why is it so? Do I really need to have <strong>double</strong> <code>await</code>? What if the following case?</p>

<pre><code>    public async Task&lt;string&gt; DoBusyJob()
    {
        // How to prevent Hang?
        for (int j = 0; j &lt; 10000000; j++) {
            double m = Math.Sqrt(1) + Math.Sqrt(2) + Math.Sqrt(3);
        }
        i++;
        return "Finished " + i;
    }

    int i = 0;

    private async void button1_Click(object sender, EventArgs e)
    {
        // Hang!
        string result = await DoBusyJob();

        this.label1.Text = result;
    }
</code></pre>
