DPC queue organisation

Hi,

According to the following link,
https://msdn.microsoft.com/en-us/library/windows/hardware/ff558754(v=vs.85).aspx

there is a DPC queue for each processor, and an application can run on
any processor.

In this context, how can I be sure that all the DPCs I am scheduling
will be dequed following the FIFO model ?

Thanks in advance.

Matthieu

Well, you could all queue them to one processor I guess.

But I’d suggest you’re not thinking about the problem in the best possible way. A DPC is nothing more than a deferred callback to an arbitrary process context that will run in kernel mode. So, I’d suggest what you want to do is create and maintain a private list of “things to do” that you maintain in a FIFO model. When each DPC executes, it removes the first entry from this private list and does whatever it’s supposed to do.

If that won’t work, I’d recommend you tell us the end-goal you’re trying to achieve (as opposed to how to use specific OS feature in a specific way that it was not intended to be used) and we can help you further.

Peter
OSR
@OSRDrivers

On 2016-05-11 11:35:46 +0000, xxxxx@osr.com said:

Hi !

Well, you could all queue them to one processor I guess.

But I’d suggest you’re not thinking about the problem in the best
possible way. A DPC is nothing more than a deferred callback to an
arbitrary process context that will run in kernel mode. So, I’d
suggest what you want to do is create and maintain a private list of
“things to do” that you maintain in a FIFO model. When each DPC
executes, it removes the first entry from this private list and does
whatever it’s supposed to do.
You are right, I didn’t see the problem the best possible way, I should
have thought about this solution :slight_smile:

If that won’t work, I’d recommend you tell us the end-goal you’re
trying to achieve (as opposed to how to use specific OS feature in a
specific way that it was not intended to be used) and we can help you
further.

Peter
OSR
@OSRDrivers

Thanks a lot !