As I understand it, Task.Yield
at the beginning of a method will force the caller to continue if it is not awaiting the method. Meanwhile Task.Run
and ConfigureAwait(false)
both run a Task on a new thread pool thread, which again will force the caller to continue if it is not awaiting the method.
I can't understand the difference between Task.Yield
and running a new thread pool thread, since right after it returns to the caller, it will continue executing the rest of the method, which is essentially the same thing.
This post suggests that Yield
and Task.Factory.StartNew
(which is really just the old version of Task.Run
) can be used interchangeably, which seems confusing to me.