Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


ConfigureAwait(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-configur...


In C#/ASP.Net use Context.Items or otherwise create your own context to track what you need.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: