As you know, it it a good idea to call Task.ConfigureAwait(false)
when you are waiting on a task in a code that does not need to capture a synchronization context, because it can cause deadlocks otherwise.
Well, how often do you need to capture a synchronization context? I my practice, very rarely. In most situations I am working with "library" code that pretty much forces me to use Task.ConfigureAwait(false)
all the time.
So my question is pretty simple: why Task.ConfigureAwait(false)
is not the default option for a task? Would not it be much better to force "high-level" code to use Task.ConfigureAwait(true)
? Is there a historical reason for it, or am I missing something?