Windows cli工具来监控信号量?

发布于 2024-09-16 11:51:43 字数 144 浏览 2 评论 0原文

在Windows中,有没有可以从命令行查看信号量的工具?

SysInternals“Process Explorer”在图形用户界面上做得很好,SysInternals“handle.exe”从命令行查看句柄,但我没有找到任何可以从命令行枚举信号量的东西?

In Windows, is there a tool to view semaphores from the command line?

SysInternals "Process Explorer" does a great job from a gui, and the SysInternals "handle.exe" view handles from the command line, but I've not found anything to enumerate semaphores from the command line?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

杀手六號 2024-09-23 11:51:43
handle.exe -s -p [processid]

将给出该进程 ID 的信号量数量。这是输出,

handle.exe -s -p 388

其中 388 是我正在运行的 Chrome 选项卡的进程 ID。

手柄 v3.51
版权所有 (C) 1997-2013 马克·鲁西诺维奇
Sysinternals - www.sysinternals.com

Handle type summary:
  ALPC Port       : 2
  Desktop         : 1
  Directory       : 4
  EtwRegistration : 25
  Event           : 37
  File            : 14
  IoCompletion    : 2
  Key             : 7
  KeyedEvent      : 1
  Mutant          : 4
  Section         : 14
  Semaphore       : 27
  Thread          : 16
  Timer           : 1
  TpWorkerFactory : 8
  WindowStation   : 2
Total handles: 165

handle.exe -a -p [processid] 

将列出所有句柄及其类型;你可以使用 grep: 之类的东西

handle.exe -a -p 388 | grep Semaphore

来获得如下输出:

  20C: Semaphore
  210: Semaphore
  218: Semaphore
  21C: Semaphore
  220: Semaphore
handle.exe -s -p [processid]

will give the number of semaphores for that process id. Here is the output of

handle.exe -s -p 388

where 388 is the process id of a Chrome tab I have running.

Handle v3.51
Copyright (C) 1997-2013 Mark Russinovich
Sysinternals - www.sysinternals.com

Handle type summary:
  ALPC Port       : 2
  Desktop         : 1
  Directory       : 4
  EtwRegistration : 25
  Event           : 37
  File            : 14
  IoCompletion    : 2
  Key             : 7
  KeyedEvent      : 1
  Mutant          : 4
  Section         : 14
  Semaphore       : 27
  Thread          : 16
  Timer           : 1
  TpWorkerFactory : 8
  WindowStation   : 2
Total handles: 165

handle.exe -a -p [processid] 

will list all the handles with their types; you could use something like grep:

handle.exe -a -p 388 | grep Semaphore

to get output like this:

  20C: Semaphore
  210: Semaphore
  218: Semaphore
  21C: Semaphore
  220: Semaphore
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文