On Mon May 5 11:39:34 2025 +0000, Matteo Bruni wrote:
I'm also not completely sure about putting all the cancelled asyncs
in a process-wide list. Other threads cancelling async in the same process would wait on all the process previously cancelled asyncs, and maybe that would need to be done per-thread? Still, is it an issue if cancelled async are possibly short-lived?
I don't think this one is an issue? asyncs are flagged immediately for
cancellation and are then ignored for future `NtCancelIoFile()` calls. Ah, I misunderstood here, you were referring to the list you introduced in your version. I guess we could restore the check that makes sure not to cancel the same async twice.
They wouldn't be cancelled twice: once cancelled, async go to the "cancelled_asyncs" list and aren't enumerated in future cancellations.
The issue I was a bit concerned about was that threads which cancel async would wait for every async in the "cancelled_asyncs" list, not just the ones it added there. But like you said it's probably not a big issue if it's only a transient state.