阅读:1788回复:7
任意线程上下文?
任意线程上下文的概念?
任意线程上下文和非任意线程上下文的区别? 谢谢! |
|
沙发#
发布于:2002-12-05 10:10
术语“任意线程上下文(arbitrary thread context)”和“非任意线程上下文(nonarbitrary thread context)”用于精确描述驱动程序例程执行时所处于的上下文种类
任意线程上下文:意味着我们不能阻塞该线程,也不能直接访问用户模式虚拟内存。 |
|
|
板凳#
发布于:2002-12-05 10:26
还是有点糊涂,能不能再详细点?
|
|
地板#
发布于:2002-12-05 10:42
thread context :
The execution state of a thread at any given moment: For a user-mode thread, the platform-dependent register state, kernel stack, TEB, and user stack in the address space of the process to which the thread belongs. For a kernel-mode thread, the platform-dependent register state and kernel stack. Kernel-mode threads have neither a TEB nor a user-mode context, but they must have an associated process. See also process object. Most Windows NT/Windows 2000 drivers do not have a context in this sense. Unless a driver (such as an FSD) creates its own process and/or thread(s), it does not have its own stack space or register state. For each driver, the set of objects it owns and the IRPs that it can access in the device queue associated with its device object or any driver-created internal queue(s) can be considered all or part of its context 该给分了吧! |
|
|
地下室#
发布于:2002-12-05 11:12
那非线程上下文泥?(我是在看了站上的一个资料后,才想了解这个问题的)
最好能用中文来描述一下。 what is TEB? 相信我,好不好!分我一定要给你的! |
|
5楼#
发布于:2002-12-05 11:52
那非线程上下文泥?(我是在看了站上的一个资料后,才想了解这个问题的) TEB =Thread environment block |
|
|
6楼#
发布于:2002-12-08 20:26
任意线程上下文是指,我们不能确定当前是什么线程在执行,比方说,中断一般是在任意线程上下文中执行,因为,你不知道中断发生是,什么线程在执行,
非...是指,你知道当前什么线程在执行. |
|
|
7楼#
发布于:2002-12-09 09:17
任意线程上下文是指:当我们的驱动程序执行的时候,如果它要对同属于一个进程的其他线程进行操作,它首先要获得该线程的句柄,随后通过该句柄操作,然而,当其获得线程句柄的时刻系统返回的却可能是其他进程下的拥有相同句柄名的句柄值,这时候你用该句柄去操作就是错误的,因为此时系统执行的可能是相同进程的线程,也可能不是,我们就把这种线程叫任意线程上下文。所以你不能任意阻塞它。如果此时驱动程序直接对用户空间操作,则可能访问到的却是其他进程的用户空间,因此你不能访问用户空间。
非任意线程上下自然就是指上面的反过来理解就对了。^_^ |
|
|