Quantcast
Channel: .NET Framework Class Libraries forum
Viewing all articles
Browse latest Browse all 8156

IN Async/await, Will the thread that handles the completion of the operation have all the same state?

$
0
0

I've heard that the executionContext flows from the thread that started the async operation, to the thread that handles its completion. I'm wodering, in web api, does HttpContext, RequestContext, Thread.CurrentPrincipal, Thread.CurrentContext, etc all have the same data copied over when the completion handling thread begins executing?

Along those lines, If I authenticated a user and set the principal to REquestContext.Principal in an async action, I assume that this context would flow to the thread that handles the continuation of the operation after it comes back and the data I put on the REquestContext would be the same.

thanks all!

 

Viewing all articles
Browse latest Browse all 8156

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>