Async and asynchronous methods clarification?

前端 未结 2 1929
伪装坚强ぢ
伪装坚强ぢ 2021-01-07 06:24

AFAIK - ( and I read a lot about it), asynchronous methods (not asynchronous delegates !) exists to solve the \"thread is blocked\" problem when

2条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-07 07:06

    Async methods are not just for IO - they can be for anything - and yes, it's just another way of saying that the work of the method is executed in a separate thread. Any method where the calling thread offloads the work to a separate thread can be correctly called an "async" method. It is the same as Task and ContinueWith -- ContinueWith is just another way of talking about a callback, really.

    The word "asynchronous" simply means "not at the same time" - it can refer to any actions that happen independently of each other.

提交回复
热议问题