Uh oh!
There was an error while loading. Please reload this page.
Cancellable: Use AsyncLocal instead of ThreadStatic - #17156
Conversation
❗ Release notes required
|
majocha
commented
May 16, 2024
@auduchinok, Does it make sense? |
auduchinok
commented
May 16, 2024
From a glance, yes, thanks! I’ll probably need to do some testing just in case, though :) |
I'm trying to write some tests using |
OK, the problem with testing the cancellable CE is as described here: It is internal and exposed to the test project via InternalsVisibleTo, which clashes with inlining.
I can't think of a way around this limitation. |
Yeah, I don't think there's a way around it. When I tried to rewrite it to resumable code, I hit some issues with inlining cross projects. |
majocha
commented
May 25, 2024
One thing that comes to my mind is to include link to |
Similar to #16779, Keeping the token in
AsyncLocalcould work better in scenarios with lots of parallelism like we have in Transparent Compiler.todo: add some tests mixing cancellable with async, TPL, thread switching etc.
related: #16137, #16348, #16536