Windows 中是否有监视同步对象(互斥锁、事件、信号量)的工具?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/801284/
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-15 12:22:27  来源:igfitidea点击:

Is there a tool to monitor synchronisation objects (mutex, events, semaphores) in Windows?

c++windowsvisual-studiosynchronization

提问by sep

In Windows, is there a tool to monitor the status of process synchronisation objects? ie.

windows下有没有监控进程同步对象状态的工具?IE。

  • event/mutex : signaled or not signaled
  • semaphore : count
  • 事件/互斥体:有信号或没有信号
  • 信号量:计数

Better yet, to log which thread did what, eg. "thread #5421 Signal Event - testevt"

更好的是,记录哪个线程做了什么,例如。“线程 #5421 信号事件 - testevt”

采纳答案by aJ.

Memory Validator

内存验证器

Process Explorer

进程浏览器

Handleusage: handle -s ==> Print count of each type of handle open.

句柄用法:handle -s ==> Print count of each type of handle open.

[EDIT]:

[编辑]

How to monitor the status of process synchronization objects using Process Explorer.

如何使用 Process Explorer 监视进程同步对象的状态。

Open Process Explorer

打开进程资源管理器

  • Click on your exe in the process section (for ex: MyApp.exe)
  • Click Show Lower Pane(or press Ctrl+L). This will show all synchronization objects. (for ex: myEvent)
  • Right click on synchronization object (for ex: myEvent) and click Properties... in context menu.
  • This brings the details of the synchronization object. In the Detailstab, you can see

    Event Info(if synch object is event): Gives information about the state (whether the synchronization object is signaled)

    Semaphore info(if synch object is semaphore): Provides the count of the semaphore.

  • 在进程部分单击您的 exe(例如:MyApp.exe)
  • 单击Show Lower Pane(或按Ctrl+L)。这将显示所有同步对象。(例如:myEvent)
  • 右键单击同步对象(例如:myEvent),然后单击上下文菜单中的属性...。
  • 这就带来了同步对象的细节。在Details选项卡中,您可以看到

    Event Info(如果同步对象是事件):提供有关状态的信息(同步对象是否已发出信号)

    Semaphore info(如果同步对象是信号量):提供信号量的计数。

回答by Sean Turner

Take a look at Intel's ThreadChecker and Parallel Studio. Most of their tools sit on top of Visual Studio.

看看英特尔的 ThreadChecker 和 Parallel Studio。他们的大多数工具都位于 Visual Studio 之上。

http://software.intel.com/en-us/intel-vtune/

http://software.intel.com/en-us/intel-vtune/

http://software.intel.com/en-us/intel-thread-checker/

http://software.intel.com/en-us/intel-thread-checker/

http://software.intel.com/en-us/intel-vtune/

http://software.intel.com/en-us/intel-vtune/

回答by Stephen Kellett

Thread Validatordoes what you are describing.

线程验证器执行您所描述的操作。

Monitor threads, status of locks, individual thread objects. Much faster than Intel's Thread Checker, but different level of detail.

监控线程、锁状态、单个线程对象。比英特尔的线程检查器快得多,但详细程度不同。

回答by anand

Windbg can be helpful but you have to learn how to use it.

Windbg 可能会有所帮助,但您必须学习如何使用它。