Is prevTask.Wait() recommended to be used with ContinueWith (from the Tasks library)?

前端 未结 7 1377
独厮守ぢ
独厮守ぢ 2020-12-07 15:40

So I was told recently that how I was using my .ContinueWith for Tasks was not the proper way to use them. I have yet to find evidence of this on the internet so I will ask

7条回答
  •  忘掉有多难
    2020-12-07 15:49

    You might also want to consider using Task.Run instead of Task.Factory.StartNew.

    Stephen Cleary's blog post and the Stephen Toub's post that he references explain the differences. There is also a discussion in this answer.

提交回复
热议问题