DPC

Hi there,
Who can interpret the DPC (Deferred Procedure Call )mechanism in Win2K
plainly?
I try to understand it through the book “Inside Windows 2000”,Chapter 3. but
it seems too obscure for me.

Andy

In what exactly are you interested ? What are DPCs or how is the DPC
mechanism implemented in NT ?

Dan
----- Original Message -----
From: “Andy Hao”
Newsgroups: ntdev
To: “NT Developers Interest List”
Sent: Thursday, March 27, 2003 11:42 AM
Subject: [ntdev] DPC

>
> Hi there,
> Who can interpret the DPC (Deferred Procedure Call )mechanism in Win2K
> plainly?
> I try to understand it through the book “Inside Windows 2000”,Chapter 3.
but
> it seems too obscure for me.
>
> Andy
>
>
>
>
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@rdsor.ro
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>

Can you be more specific? This is a pretty wide subject. Which part is too
obscure?

If you don’t have a precise question, it’s unlikely that someone will
“rewrite the book” in this forum.

Mat

-----Original Message-----
From: Andy Hao [mailto:xxxxx@yahoo.com]
Sent: Thursday, March 27, 2003 4:42 AM
To: NT Developers Interest List
Subject: [ntdev] DPC

Hi there,
Who can interpret the DPC (Deferred Procedure Call )mechanism in Win2K
plainly?
I try to understand it through the book “Inside Windows 2000”,Chapter 3. but
it seems too obscure for me.

Andy


You are currently subscribed to ntdev as: xxxxx@guillemot.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

DPC is a callback which is scheduled to be called, and then called by
the OS.

If the CPU is on < DISPATCH_LEVEL - then the DPC will be called
immediately.

If the CPU is on >= DISPATCH_LEVEL - then the DPC will be put to
queue, and the queue (or at least the part of it - there is a thing
called IdealDpcRate in the registry) will be drained just before
somebody will ask the CPU to go < DISPATCH_LEVEL.

DPCs are always executed at DISPATCH_LEVEL (and thus are subject to
restrictions of this IRQL), and never preempt one another on the same
CPU. On several CPUs, the same DPC can run on 2 CPUs simultaneously.

Queueing the DPC - KeInsertQueueDpc - can be done at any IRQL,
including ISRs.

The notions of “current thread” and “current process” do not exist for
DPCs. KeGetCurrentThread will return some arbitrary thread pointer.

At the moment the routine is called, KDPC structure is not on the
queue and thus can be freed.

Timer callbacks are DPCs.

Usually, DPCs are used as second-half of the IRQ handler, running with
interrupts unmasked.
For instance, things like the network receive paths - up to TDI
client - are called from ndisMDpc which is queued by NDIS.SYS if the
miniport interrupts.

IRP completion routines are often called from some DPC, especially for
lowest-level driver which talks to hardware - it uses DpcForIsr to
call IoCompleteRequest.

Max

----- Original Message -----
From: “Andy Hao”
Newsgroups: ntdev
To: “NT Developers Interest List”
Sent: Thursday, March 27, 2003 12:42 PM
Subject: [ntdev] DPC

>
> Hi there,
> Who can interpret the DPC (Deferred Procedure Call )mechanism in
Win2K
> plainly?
> I try to understand it through the book “Inside Windows
2000”,Chapter 3. but
> it seems too obscure for me.
>
> Andy
>
>
>
>
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to
xxxxx@lists.osr.com
>