问题描述
您好,
我最近写了一个应用程序,用于测试
老化室中的单元。它使用两个外部库,需要使用
P\Invoke才能使用它们。有一个主线程和一个
辅助轮询线程。每隔一段时间,这个过程就会消耗掉接近100%的CPU,但我不明白为什么。我想知道
我怎么去确定问题的原因?我应该使用什么样的工具或工具来确定代码的哪个部分导致了问题。非常感谢任何帮助。
我知道在硬件世界中我可以实现一个监视器来重启
系统,这样的东西会有用吗?我必须保持系统的跟踪,因此会运行得更慢并消耗更多的资金,但是我可能会在进程恢复时恢复
问题???
马克
Hello,
I recently wrote an application that is used for testing units in a
burn-in chamber. It uses two external library that require the use of
P\Invoke in order to work with them. There is a primary thread and a
secondary polling thread. Every once in a while the process will
consume close to 100% of the CPU, but I am unclear why. I am wondering
how would I go about determine the cause of the problem? What sort of
tools or instrumentation should I use in order to determine what part
of the code is causing the problem. Any help is greatly appreciated.
I know in the hardware world I could implement a watchdog to restart
the sytem, would something like that be useful? I would have to keep
track of the system thus is would run slower and consume more
resources, but I might be able to recover when the process has
problems???
Mark
推荐答案
这篇关于应用程序消耗接近100%的CPU,如何分析和确定原因的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!