3 ms·
In C#, your tasks are submitted to the ambient task scheduler. In ASP.NET, this is (I believe) the main thread pool that handles requests. The only time I've ev
by kbsletten 7y ago
In C#, your tasks are submitted to the ambient task scheduler. In ASP.NET, this is (I believe) the main thread pool that handles requests. The only time I've ever had to care where something was running is when adding response headers because that's available as a thread local API that can't happen on another thread, but it's generally ended up as a "it hurts when I do this" kind of situation.
- tracker1 7y agoIn C#/ASP.Net use Context.Items or otherwise create your own context to track what you need.
- deskamess 7y agoConfigureAwait(false) may help if you want it to run "not in the current context". Has UI/library use cases [1]. https://medium.com/bynder-tech/c-why-you-should-use-configureawait-false-in-your-library-code-d7837dce3d7f https://medium.com/bynder-tech/c-why-you-should-use-configur...