Thread Id and Thread Handle
来源:互联网 发布:张大奕淘宝店铺 编辑:程序博客网 时间:2024/04/30 13:36
关于Thread id和Thread handle的区别,这篇文章讲的很清楚:
http://hi.bccn.net/space-21499-do-blog-id-17530.html
简而言之,handle包含了访问权限的信息,使用handle来控制内核对象,而且一个内核对象可以对应多个handle。
而Id只是一个全局唯一的标识符。
两者之间的相互转换:
Handle -> Id:GetThreadId
Id -> Handle:OpenThread()
注意在Wince5.0及以下版本中没有OpenThread()这个函数,我的调查结果是可以用GetThreadId() 代替。
MSDN上说,GetCurrentThreadId(): returns the thread identifier, which is used as a handle of the calling thread.
看看CE5.0上CreateThread() 的实现:DoCreateThread() in private/winceos/coreos/nk/kernel/schedule.c, at the bottom of this method:
if (lpthid)
*lpthid = (DWORD)hth;
所以看见thread id就是从thread handle转换来的,它俩一样一样的。
- Thread Id and Thread Handle
- Question about thread exit code and thread handle value
- get android process id and thread id
- 输入淘宝ID关键字显示内容(采用Thread+handle)
- Thread id
- exploiting-leaked-thread-handle
- Thread Synchronization - UI Thread and Worker Thread
- get linux thread id
- gdb break line thread thread-id
- android handle thread runnable的关系
- Android Handle Thread Message 小说明
- Android异步机制详解一:THread+Handle
- Thread + Handle 解决子线程更新UI
- android多线程编程(Thread,Handle,AsycTask)
- Thread
- thread
- Thread
- Thread
- Spring3 MVC 深入研究
- c++中宏定义## 的用法
- 缩小造成问题的原因
- VC调用C#写的DLL
- HDU1166树状数组
- Thread Id and Thread Handle
- SQL 数据库备份
- 创建VLAN的程序代码
- iphone4原理图
- 公司HR面试经常问的问题及回答思路
- 内存颗粒和模组编号知识60问
- g723源码详细分析-14-感知加权滤波器补充
- linux系统故障修复
- ADO.Net实用技巧两则