what is difference between these two
await GetGroupMembers().ConfigureAwait(false);
vs.
await Task.Run(GetGroupMembers);
If i'm correct : A) only the continuation may get executed on a separate context (continuation = code after the first really-blocking await) B) even the first part of the method gets executed on a separate context
Yeah, agree, Task.Run immediately discards the synchronization context, while configureawait does so for the first continuation. I guess it is also noteworthy that Task.Run() therefore already runs synchronous steps of the async method ahead of the first async dispatch on a potentially different thread from the Tp
But in B he passes the method group as argument, not the result of a call..
Обсуждают сегодня