如何确定Win32线程处于C ++中的Wait或Join或Sleep状态 [英] How to determine that a win32 thread is either in Wait or Join or Sleep state in c++

查看:211
本文介绍了如何确定Win32线程处于C ++中的Wait或Join或Sleep状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我实际搜索的是.net ThreadState枚举.

What I actually search for is c++/win32 equivalent for .net ThreadState Enumeration.

有什么建议吗?

推荐答案

两者之间几乎没有什么区别,都是等待不同的内核对象.

There's very little difference between these, all are waits for different kernel objects.

通过等待",我假设您的意思是"I/O等待". 加入"只是等待线程/进程". 睡眠"是等待计时器".

By "Wait" I assume you mean "I/O wait". "Join" is just "wait for a thread/process". And "Sleep" is "wait for a timer".

更为复杂的是,线程可能正在等待内核对象的某种组合.

To complicate matters more, a thread can be waiting for some combination of kernel objects.

您可以使用内核调试器找出线程正在等待哪些对象以及这些对象的类型.我认为没有任何更简单的方法.

You could find out what objects a thread is waiting for, and the type of those objects, using a kernel debugger. I don't think there's any simpler way.

这篇关于如何确定Win32线程处于C ++中的Wait或Join或Sleep状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆