I understand that it\'s recommended to use ConfigureAwait(false)
for await
s in library code so that subsequent code does not run in the caller\'s e
In this case, your Task.Run
version will have a bit more overhead, as the first await call (await client.GetAsync(address)
) will still marshal back into the calling context, as will the results of the Task.Run
call.
In the first example, on the other hand, your first Async()
method is configured to not require marshaling back into the calling context, which allows the continuation to run on a background thread still. As such, there won't be any marshaling back into the caller's context.