Windows 7会报告“程序未响应".当运行大量Cruncher的Visual C ++时 [英] Windows 7 reports "program not responding" when a heavy number-cruncher Visual C++ is running

查看:88
本文介绍了Windows 7会报告“程序未响应".当运行大量Cruncher的Visual C ++时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行一个Visual C ++程序,该程序本质上必须花费数小时进行计算,同时又不能与Windows进行交互.这不是一个错误-只是一个漫长的计算. Windows 7将其解释为无响应".我如何解决该问题,以使Windows在程序仍在处理数字时不会放弃?非常感谢您的期待.善良,我是个白痴!

I''m running a Visual C++ program which by its nature has to spend hours calculating and meanwhile not interacting with Windows. This isn''t a mistake - just a long calculation. Windows 7 interprets this as "not responding". How can I fix it so Windows doesn''t give up while the program is still number crunching? Many thanks in anticipation. Be kind, I''m an idiot!

推荐答案

在这种情况下,这绝对是正常的行为.您应该只做一件事:使用线程.
—SA
This is absolutely normal behavior in this situation. You should do only one thing: use threading.
—SA


如果您的计算需要几个小时,请认真查看
CUDA和CUBLAS [ http://www.tomshardware.com/reviews/nvidia-cuda-gpgpu,2299.html [^ ]

显然,正如SAKryukov所建议的那样,将数字运算处理到另一个线程是一件好事,甚至,如果可能的话,甚至可以使用多个线程将其分配给多个内核.这可能需要大量的重新设计-或者如果您幸运的话,只需在线程之间设计外部循环的迭代即可.

您可能会发现 ACE [
If your calculation takes several hours - take a serious look at
CUDA and CUBLAS[^] - for a typical number crunching application - an iterative solver - it ought to do wonders.

Here is some info on what you may expect to gain
http://www.tomshardware.com/reviews/nvidia-cuda-gpgpu,2299.html[^]

Obviously, moving your number crunching to another thread, as SAKryukov suggests, is a good thing to do, and even splitting it, if possible, among multiple cores using multiple threads. This may require a significant amount of redesign - or if your lucky - simply deviding the iterations of the outer loop between the threads.

You may find that ACE[^] has the C++ classes required to facilitate this move in a very elegant manner.

Best regards
Espen Harlinn


只需在辅助线程中进行计算即可. 有关工作线程的优秀资源 [ ^ ]. :)

如果您需要进一步的帮助,则必须共享有关您的应用程序的更多详细信息.
GUI 还是 Console 应用程序,它是否使用 MFC ,即使您可以发布代码的相关部分,也欢迎使用这些详细信息. :)
Just make your calculations in a worker thread. An excellent resource on worker threads[^]. :)

If you need further assistance you have to share more details about your application.
Is it GUI or Console application, does it use MFC, even you can post relevant parts of your code, these details are all welcome. :)


这篇关于Windows 7会报告“程序未响应".当运行大量Cruncher的Visual C ++时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆