System Worker Threads
来源:互联网 发布:网络查询名下有无公司 编辑:程序博客网 时间:2024/06/05 15:45
http://msdn.microsoft.com/zh-cn/library/ff564587.aspx
先翻译成自己能看懂的。。。
To use a work item, a driver performs the following steps:
Allocate and initialize a new work item.
The system uses an IO_WORKITEM structure to hold a work item. To allocate a new IO_WORKITEM structure and initialize it as a work item, the driver can call IoAllocateWorkItem. In Windows Vista and later versions of Windows, the driver can alternatively allocate its own IO_WORKITEM structure, and callIoInitializeWorkItem to initialize the structure as a work item. (The driver should call IoSizeofWorkItem to determine the number of bytes that are necessary to hold a work item.)
分配和初始化一个新的工作.
操作系统使用IO_WORKITEM结构来表示一个工作节点,驱动程序可以调用IoAllocateWorkItem来分配和初始化一个工作节点.
在windows vista及其后续版本中,驱动程序可以选择先为自己分配IO_WORKITEM结构再调用IoInitializeWorkItem来初始化一个工作节点.(程序可以调用IoSizeofWorkItem来获取一个工作结构的大小.)
Associate a callback routine with the work item, and queue the work item so that it will be processed by a system worker thread.
To associate a WorkItem routine with the work item and queue the work item, the driver should call IoQueueWorkItem. To instead associate a WorkItemExroutine with the work item and queue the work item, the driver should call IoQueueWorkItemEx.
然后要将一个回调函数与工作节点绑定起来并插入到系统工作队列中,程序可以调用IoQueueWorkItem来完成这个.但是如果程序是使用WorkItemEx来表示工作节点的话就要使用IoQueueWorkItemEx来绑定和插入到系统工作队列里.
After the work item is no longer required, free it.
A work item that was allocated by IoAllocateWorkItem should be freed by IoFreeWorkItem. A work item that was initialized by IoInitializeWorkItem must be uninitialized by IoUninitializeWorkItem before it can be freed.
The work item can only be uninitialized or freed when the work item is not currently queued. The system dequeues the work item before it calls the work item's callback routine, so IoFreeWorkItem and IoUninitializeWorkItem can be called from within the callback.
在工作节点不再需要后,要记得释放掉,被IoAllocateWorkItem分配的工作节点可以使用IoFreeWorkItem.被IoInitializeWorkItem初始化的工作节点要在其释放前调用IoUninitializeWorkItem.只有在工作节点没有被正确的插入到队列时才可以调用这些函数来释放它.如果成功插入队列以后,操作系统自己会在调用完该节点的回调函数后会将该节点移出队列.所以可以在回调函数里调用IoFreeWorkItem和IoUninitializedWorkItem来释放工作节点.
- System Worker Threads
- System Worker Threads
- Using Worker Threads
- Using Worker Threads
- 配置 max worker threads 服务器配置选项
- 谈谈SQL server的 worker threads
- system worker thread---from ddk
- Threads
- Threads
- Threads
- Threads
- Worker
- c3 Threads - Running Threads
- 7.Threads
- 线程 threads
- Creating Threads
- Creating Threads
- Redo Threads
- 清除sqlserver数据库日志文件
- [算法题] 求数组的子数组之和的最大值
- [算法题] 求数组的子数组之和的最大值
- [算法题] 求数组的子数组之和的最大值
- vs2008安装部署工程制作教程
- System Worker Threads
- c++的万年历类,支持显示某月月历与某年年历,支持计算任意两个日期的间隔天数
- 查看文件内容
- Squid代理服务器设置
- Linux下文件夹权限
- android学习---- WindowManager.LayoutParams
- 关于支付宝重组的口水战已经太多
- 树的深度优先非递归算法
- extjs智能提示 (myeclipse添加spet插件)