WaitAll vs WhenAll

后端 未结 4 1924
夕颜
夕颜 2020-11-22 11:45

What is the difference between Task.WaitAll() and Task.WhenAll() from the Async CTP ? Can you provide some sample code to illustrate the different

4条回答
  •  無奈伤痛
    2020-11-22 12:43

    What do they do:

    • Internally both do the same thing.

    What's the difference:

    • WaitAll is a blocking call
    • WhenAll - not - code will continue executing

    Use which when:

    • WaitAll when cannot continue without having the result
    • WhenAll when what just to be notified, not blocked

提交回复
热议问题