On Feb 17, 2006, at 2:57 PM, Brad Post wrote:
I was wondering if there are built-in methods for creating and using DPC’s (deferred procedure calls) like in the Windows environment.
Brad,
There's a good posting on the thread_call KPI here:
which implements the moral equivalent of deferred procedure calls (as I understand them) for MacOS.
In reading up on DPCs a little, I note that they seem to be used to decouple interrupt processing from the interrupt context. Note that under I/O Kit, unless you are in an interrupt filter handler you are already in a decoupled context (i.e. you are scheduleable and pre-emptable), so if your sole goal is to avoid blocking interrupt delivery I wouldn't worry about it.
Note however that if you're not using your own workloop, you will block others on the workloop you're sharing while your interrupt event handler runs.
There are more elegant (or obtuse) ways of using the thread_call KPI via I/O kit (one method involves subclassing IOTimerEventSource for example), but they're all built on top of those primitives.
HTH.
= Mike