Two questions here, one about Dpc and the other about IRP.
(1) Can a driver have two CustomDpc functions running at the same time? I realize that since they run at DISPATCH_LEVEL, they will be serialized on the same processor. But what about different processors?
My guess is that they are not serialized, and so can run concurrently on different processors. That would mean that the routines need to use some synchronization method to serialize access to critical data.
But before I put this synchronization into the Dpc routines, I thought I'd see if the routines themselves run serially across all processors.
(2) What happens when one user thread initiates IRP 1, and another thread initiates IRP 2 while IRP 1 is not yet completed? When is the driver's dispatch routine for IRP 2 called? Does the IoManager serialize the dispatch routine calls across all processors?
I want to provide exclusive access to a shared device by having Acquire and Release IOCTLs. I plan to have the Acquire function post the IRP with DEVICE_BUSY if another Acquire is in effect, rather than put the calling thread in a wait state. It would be nice if the IOCTL dispatch calls run serially, so that I don't have to worry about synchronization issues.