Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing System.Threading .AsyncLocal #143

Open
NN--- opened this issue Jan 24, 2021 · 2 comments
Open

Missing System.Threading .AsyncLocal #143

NN--- opened this issue Jan 24, 2021 · 2 comments

Comments

@NN---
Copy link
Collaborator

NN--- commented Jan 24, 2021

https://docs.microsoft.com/en-us/dotnet/api/system.threading.asynclocal-1?view=net-5.0

@OwnageIsMagic
Copy link
Collaborator

https://blog.stephencleary.com/2013/04/implicit-async-context-asynclocal.html

Similar code will compile targeting .NET 4.0 (with Microsoft.Bcl.Async); however, it will not work correctly (unless it happens to run on .NET 4.5) because the logical call context is not copied at the right time. In that situation, different parts of different async methods will end up sharing the same stack (and overwriting each other’s stack).

@NN---
Copy link
Collaborator Author

NN--- commented Feb 4, 2021

Maybe there is some hack we can do ?:)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants