Operation and Goals |
Operates threads; multiple threads may have different operation goals |
A thread is operated by a thread handle |
Value Obtained by Open Thread |
Different for different processes |
The process-local value obtained through the operating system |
Uniqueness in Windows System |
Unique identification of a thread within the scope of the Windows system |
Unique globally but users can capture the handle of a thread through this ID |
Scope |
System-wide |
Process-local |
Bridge for OS and Client |
Acts as a bridge for operating processes and threads between the OS and client |
Used by the operating system to identify processes and threads; contains reference count and related attributes |
Kernel Object |
Not a kernel object |
A kernel object |
Creation |
Automatically generated by the OS when using CreateThread |
Created and managed by the operating system as part of the thread management system |
Use for Identification |
Used by the operating system to identify processes and threads |
Used by users to identify processes and threads and perform operations on them |
Uniqueness Verification |
Uniquely corresponds within the Windows system; threads with the same ID must be the same thread |
The same handle must identify the same thread; the same thread may have multiple handles, so the handle alone may not distinguish between threads |
Distinction between Threads |
If two threads return the same thread ID, they must be the same thread; otherwise, they originate from different threads |
Two threads may have the same handle, so using the handle alone may not distinguish between threads |