任何显示正在运行的线程的详细信息的 Windows 工具?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4385994/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 07:50:54  来源:igfitidea点击:

Any Windows tool to show details of running threads?

windowsmultithreadingprocess

提问by Ahmad

I'm trying to find a tool similar to the Windows Task Manager utility which can show details on all threads running in a given process, such as their names, IDs, etc ..

我试图找到一个类似于 Windows 任务管理器实用程序的工具,它可以显示给定进程中运行的所有线程的详细信息,例如它们的名称、ID 等。

Windows Task Manager only lists the number of threads running in a given process .. It doesn't give any thread specific information ..

Windows 任务管理器只列出给定进程中运行的线程数.. 它不提供任何线程特定信息..

采纳答案by darioo

Try using Process explorer. It's much more powerful than task manager and should suit your needs.

尝试使用Process explorer。它比任务管理器强大得多,应该适合您的需求。

回答by Malick

You can also try processHackerwhich is free, Open source and mature.It has more option than ProcessExplorer.

您也可以尝试免费、开源且成熟的processHacker。它比 ProcessExplorer 有更多的选择。

回答by Pressacco

THREAD DETAILS

螺纹细节

As darioohas already commented, applications like Process Explorerfrom Microsoft (previously: System Internals) can provide additional information about an application's threads:

正如darioo已经评论过的,像Microsoft Process Explorer这样的应用程序(以前:System Internals)可以提供有关应用程序线程的附加信息:

  • ThreadId
  • Kernel Time
  • User Time
  • Starting address
  • Current State
  • Context Switches
  • etc.
  • 线程 ID
  • 内核时间
  • 用户时间
  • 起始地址
  • 当前状态
  • 上下文切换
  • 等等。

Process Explorercan be downloaded for freefrom here.

Process Explorer可以从这里免费下载。

THREAD NAME

线程名称

The original question also inquired about determining a thread's name.

最初的问题还询问了如何确定线程的名称。

It is my understanding that the Windows operating system does not support the concept of a thread having a name. This concept only exists within the Visual Studiodevelopment environment.

据我了解,Windows 操作系统不支持具有名称的线程的概念。此概念仅存在于Visual Studio开发环境中。

If this is true, then another option to get a thread's name at run-time is print it out along with your debug/log messages. At the very least, you can use this approach to keep track of thread lifetime. For example:

如果这是真的,那么在运行时获取线程名称的另一个选项是将它与调试/日志消息一起打印出来。至少,您可以使用这种方法来跟踪线程生命周期。例如:

2015/06/02 14:22:17 CoreEngine Quality Assurance thread is initializing... ThreadId=123
2015/06/02 14:22:17 CoreEngine Quality Assurance thread has initialized successfully. ThreadId=123
...
2015/06/02 16:68:17 CoreEngine Quality Assurance thread is terminating... ThreadId=123
2015/06/02 16:68:18 CoreEngine Quality Assurance thread has terminated successfully. ThreadId=123

Additional References #

其他参考资料 #