使用TID查找线程
Finding thread using TID
我正在构建一个基于wec7的应用程序。我有以下线程:
bool ChannelDataQueue::b_ChannelDataQueue_StartThread()
{
m_hThread = CreateThread(NULL, 0, ChannelDataQueue::u32_ChannelDataQueue_ReadChannelData, (LPVOID)this, CREATE_SUSPENDED, NULL);
CeSetThreadPriority(m_hThread,CE_THREAD_PRIO_256_HIGHEST);
//SetThreadPriority(m_hThread,249);//248
ResumeThread(m_hThread);
return true;
}
我使用VS2008中的远程工具来监视进程和线程,但线程只显示它们所在的进程和TID/PID。我不知道如何根据ID来确定我正在监视哪个线程。
CreateThread调用的最后一个参数是指向将接收线程ID的DWORD的指针。
示例:
bool ChannelDataQueue::b_ChannelDataQueue_StartThread()
{
DWORD threadID;
m_hThread = CreateThread(NULL, 0, ChannelDataQueue::u32_ChannelDataQueue_ReadChannelData, (LPVOID)this, CREATE_SUSPENDED, &threadID);
// At this point, inspect the threadID in the debugger,
// print it to the console, write it to a file, etc...
CeSetThreadPriority(m_hThread,CE_THREAD_PRIO_256_HIGHEST);
//SetThreadPriority(m_hThread,249);//248
ResumeThread(m_hThread);
return true;
}
相关文章:
- 从不同线程使用int64的不同字节安全吗
- 删除一个线程上有数百万个字符串的大型哈希映射会影响另一个线程的性能
- 试图创建一个多线程程序来查找0-100000000之间的总素数
- 在C++中使用线程查找友好号码比单个线程花费更多时间
- 由并发无序映射查找线程调用的函数是否安全?
- 了解多线程.试图制作一个素数查找器
- 查找使用并行线程加总数的所有组合
- 在多线程环境中使用 libcurl 会导致与 DNS 查找相关的性能非常慢
- 查找称为函数C 的线程ID
- 查找最低值.功能.错误:线程 1:EXC_BAD_ACCESS(代码 = 1,地址 = 0x7fff5fc89000)
- 从内存转储中查找线程消息队列中的消息
- 使用TID查找线程
- 在运行时查找特定线程的CPU核心
- 在 GDB 中调试多线程服务器 - 查找每个线程的状态.执行时继续并停止
- C Simple RingBuffer语言 - 多线程 - 查找关键部分
- 在单独的线程中查找素数
- 是对std::map线程安全的查找和读取操作
- 一种使用多线程在巨大树形结构中查找文件的方法
- C++从线程 ID 列表中查找 GUI 线程
- C ++挂钩到不同的应用程序,如何从进程ID中查找线程ID