多线程运行速度比多exe慢? [英] Multithread running slower than multi exe?

查看:192
本文介绍了多线程运行速度比多exe慢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序(在VS 2008中用C#编写),该应用程序处理内存中的切片数据并在处理后将其保存到文件中.
在多线程模式下,整个过程比运行多个exe慢.
例如,我有三个需要处理的图块数据.我将它们全部加载到内存中,然后创建三个三个线程来处理每个切片数据.
或者我可以启动三个exe,每个图块数据一个.

我在16处理器计算机上运行该应用程序,结果显示多exe版本比多线程版本运行MUCH的速度更快.整个应用程序除了访问图块数据并进行计算外什么也不做.

谢谢
Jennifer

I have an application (writen in C# in VS 2008)  that processes the tile data in the memory and save it into the file after process.
The whole thing runs slower in multithread mode than running multiple exe.
For example, I have three tile data need to process. I load them all into memory,then I create three three threads to process each tile data.
Or I could start three exe, and one for each tile data.

I run the application on a 16 processor computer, the result shows the multi exe version runs MUCH faster than the multi thread one. The whole application does nothing but access the tile data and does calculation. Why there is so much perfomace difference between the multi thread and multi exe?

Thanks
Jennifer

推荐答案

看起来像多线程版本的应用程序无法正常运行...我在这里看不到这种行为的任何其他原因...
Looks like multithreaded version of the application is not working properly... I don't see any other reason of such behavior here...


这篇关于多线程运行速度比多exe慢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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