DPC and APC
来源:互联网 发布:c语言将华氏温度 编辑:程序博客网 时间:2024/05/23 19:25
An asynchronous procedure call (APC) is a function that executes asynchronously. APCs are similar to deferred procedure calls (DPCs), but unlike DPCs,APCs execute within the context of a particular thread . Drivers (other than file systems and file-system filter drivers) do not use APCs directly, but other parts of the operating system do, so you need to be aware of how APCs work.
The Windows operating system uses three kinds of APCs:
- User APCs run strictly in user mode and only when the current thread is in an alertable wait state. The operating system uses user APCs to implement mechanisms such as overlapped I/O and the QueueUserApc Win32 routine.
- Normal kernel APCs run in kernel mode at IRQL = PASSIVE_LEVEL. A normal kernel APC preempts all user-mode code, including user APCs. Normal kernel APCs are generally used by file systems and file-system filter drivers.
- Special kernel APCs run in kernel mode at IRQL = APC_LEVEL. A special kernel APC preempts user-mode code and kernel-mode code that executes at IRQL = PASSIVE_LEVEL, including both user APCs and normal kernel APCs. The operating system uses special kernel APCs to handle operations such as I/O request completion.
Deferred procedure calls (DPCs). Any driver that has an ISR typically also has at least oneDpcForIsr or CustomDpc routine to complete processing of interrupt-driven I/O operations. A typical lowest-level driver'sDpcForIsr or CustomDpc routine does the following:
- Finishes handling an I/O operation that the ISR began processing.
- Dequeues the next IRP so that the driver can begin processing it.
- Completes the current IRP, if possible.
Sometimes the current IRP can't be completed because several data transfers are required, or a recoverable error was detected. In these cases, theDpcForIsr or CustomDpc routine typically reprograms the device for either another transfer or a retry of the last operation.
DPC在Driver的中断处理中经常使用。ISR通过调用IoRequestDpc激活DPC routine,处理中断引起而不能在ISR中处理的I/O操作。这些操作大多需要较长时间,且不能在较高的IRQL上运行。
APC在底层Driver中较少使用,多用于User APP和File System Driver中。和DPC的最大区别在于APC运行在某个特定线程的上下文中,而DPC运行在任意线程上下文(Arbitrary Thread Context)中。
- DPC and APC
- DPC and APC
- 转载:关于DPC和APC
- DPC
- DPC
- IRQL APC_LEVEL and APC
- IRQL APC_LEVEL and APC
- apc
- apc
- apc
- apc
- apc
- APC
- APC
- Pass4Sure APC Interactive Testing Engine and BrainDumps
- DPC函数
- DPC Timer
- DPC小记
- DPC究竟是什么
- change color demo
- Java程序员的推荐阅读书籍
- Notepad++的FunctionList(函数列表)插件中文版下载
- HTablePool的实现分析
- DPC and APC
- Java生成MD5
- vs.net快捷键.
- Android sqlite数据库操作通用框架AHibernate(二)源码-用于交流
- Android学习:NAND: could not write file ...Temp\\AndroidEmulator\TMP365.tmp异常处理
- struts原理
- 用PV操作 实现生产者-消费者问题(C++语言)
- vs2010 vc nmake编译openssl-0.9.8e
- flex上传和下载文件