Pithyness aside for a second…
So a work item guarantees you are in the ‘system’ process context or some such, right?
A threaded DPC runs as PASSIVE_LEVEL and if I understand Peter’s comment, can be queued from IRQL >= DISPATCH_LEVEL.
So that restriction is easily solved in work-item-world with a DPC that schedules a work-item so it must be somehow even different from that 'cause that seems just a bit lame.
Reading the FM (WDK DOCS) leads me to conclude that threaded DPCs were not created to make it easy for a driver writer to run a callback at PASSIVE_LEVEL by contract but a way to make it possible for the system to prioritize *some* DPC-like activity behind real-time threads. The rather terse “introduction to threaded dpcs” sort-a says “hey, it might run at PASSIVE_LEVEL, it might run at DISPATCH_LEVEL, be ready for either” as a way of warning that it is really just a DPC after all and you should not use routines that *require* IRQL == DISPATCH_LEVEL unless you explicitly raise IRQL.
So, as it kinda says, it’s a DPC but not that important that it needs to keep all threads from running. You might use it for shutting off the lawn sprinkler but not pop’n up the bagel in the toaster. Nobody likes burnt bagels but you can never put too much water on the grass (in MA in July anyway).
Does the threaded DPC ‘steal’ context and have other behaviors like being able to target a CPU, etc. like a real (non-threaded) DPC? I don’t see how it can make a context guarantee nor how to set a CPU affinity but that might just be me.
I’m just really curious 'cause someday I am sure I will have to sit through a design review where the presenter claims to have solved world hunger, perpetual motion, and gravity compensation just through the use of threaded DPCs and I would like to be able to ‘measure’ the goodness.
Thx.
-dave
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@osr.com
Sent: Tuesday, July 29, 2008 7:09 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Threaded DPCs [was Thread scheduler and deferred procedure calls]
From your ISR?
THAT’S the difference. Quite frankly, I was confused about why these were a good idea since I saw the code hit the depot. I don’t see it myself. But… you know… Cutler wrote it, so we just must be too dumb to see its brilliance.
Peter
OSR
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer