C # async / await experience

in conclusion:

  1. Asynchronous method signature method to add async, or even if returned Task is a common method.
  2. Asynchronous method call, or can be added to await without await, both ways are to return immediately, without await get is Task Objects, plus await get a T object.
  3. async method is performed before the first one to await, the main thread of execution (synchronous execution), after the first await a new thread is executing the code (asynchronous execution)
  4. Task.Wait () method will wait after the end of the specified task thread returns in the current thread. And the results can be obtained by Task.Result.

Guess you like

Origin www.cnblogs.com/BillySir/p/10930417.html