async and await are single threaded Really?

前端 未结 2 908
孤街浪徒
孤街浪徒 2021-02-04 10:54

I created following code:

using System;
using System.Threading.Tasks;

namespace ConsoleApplication2
{
    class Program
    {
        static void Main()
                


        
2条回答
  •  孤独总比滥情好
    2021-02-04 11:06

    The async and await keywords don't cause additional threads to be created.

    Yes. It moves the CPU bound or I/O bound work to other thread from the thread pool of the process so that it is not executed on UI thread or current synchronization context, it does not create a new thread which is what meant in the MSDN description.

提交回复
热议问题