vdev_disk.c spawns a thread to get around that IoCompletionRoutine is called in a different context, to sleep until signalled. Is there a better way to do async in Windows?
Instead of creating a thread and blocking until being signalled in the continuation of an IO, enqueue a work item to continue work at PASSIVE_LEVEL (i.e. schedule a continuation).
Async means continuations, otherwise you're blocking.
Instead of creating a thread and blocking until being signalled in the continuation of an IO, enqueue a work item to continue work at PASSIVE_LEVEL (i.e. schedule a continuation).
Async means continuations, otherwise you're blocking.
https://docs.microsoft.com/en-us/windows-hardware/drivers/ke...