4 ms·
That wouldn't be appropriate: whether or not execution should resume on the same context is the caller's responsibility, not that of the function you're calling
by DaiPlusPlus 5y ago
That wouldn't be appropriate: whether or not execution should resume on the same context is the caller's responsibility, not that of the function you're calling.
i.e. the same async method could be called from UI code and should resume on the UI thread immediately afterwards - or it could be called from library code - the method doesn't know that (nor does the person who wrote the method).
- jayd16 5y agoI see your point but in reality the callee did already make the decision by using Task/TPL. As a language C# leaves the continuation functionality to the specific awaitable implementation. It seems like the natural place to make a different choice. I do agree that I do not want to see it, though.