如何检测线程没有响应?

comstar 2003-08-21 10:12:03
需要检测程序的某些线程是否没有响应,然后重启程序,如何实现?
...全文
50 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
xiaohedou 2003-08-21
  • 打赏
  • 举报
回复
确定一个应用程序是否没有响应

MSN的核心讨论组讨论的应用程序是否没有响应.

> How is it possible to determine a process is "not responding" like NT Task
> Manager do?
The heuristic works only for GUI processes, and consists of calling
SendMessageTimeOut() with SMTO_ABORTIFHUNG.

>There is any API call to do the job, or this status is simply a deduction
>based on process counters, like that returned from call to GetProcessTimes
>API function?

Use SendMessageTimeout with a value of WM_NULL. That's all Task
Manager does to determine this AFAIK.

至于重启程序,我就不必首了吧

15,471

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 进程/线程/DLL
社区管理员
  • 进程/线程/DLL社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧