FileVersionInfo.GetVersionInfo()在线程应用程序中的性能 [英] FileVersionInfo.GetVersionInfo() performance in threaded app
问题描述
我正在开发一个小型部署应用程序来支持.Net文件部署到网络上7个不同位置的
。在
中它有点智能,它只部署已更改的文件,并将旧文件移动到备份
文件夹,这样大部分部署都可以完成。启动所有用户。
网络非常慢,所以我构建它以便每个部署(定义为
唯一源/目标文件夹组合)在一个单独的线程中运行。
我遇到的问题是FileVersionInfo.GetVersionInfo似乎是在表面下的单个线程中运行,或者是否有其他的
多线程问题,我不明白。每次通话的时间至少为b
两倍,并且每隔一段时间,CPU利用率达到100%且
在那里停留15-20秒,超过50%内核时间,无论
可能意味着什么。最终结果是应用程序的运行速度与单个
线程一样慢,除非它更令人讨厌。
唯一明显的争论点是线程可以在源文件夹中访问相同的
文件,但它们都是本地的或快速连接,所以
我可以''看看它会如何长时间搁置它。
有谁知道问题是什么以及如何解决它?请问单独的
AppDomain有帮助吗?流程?
谢谢,
马格努斯
你好,
我想你可能会遗漏1个要点,
*在任何给定时间只能访问1部分硬盘驱动器
驱动器头。
我认为唯一不同的情况是,如果你要的话,那么
有一个RAID设置。
尼克。
-
/ \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \\ \\ b
"无论如何。无论结果如何,你都会被改变。
Fergus - 2003年9月5日
/ \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \\ \\ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \
嗨Magsnus,
我在想它,还有我头脑中的一些东西。
但首先一个小问题。
7个同时连接的吞吐时间是否更长,或者是总处理器时间更长的总和(这是正常的)?
Cor
我认为Nak坚定不移。除非网络速度比磁盘访问/读/写速度慢
,否则那就是答案。
OHM
Nak < a@a.com>在消息中写道
新闻:Os ************** @ TK2MSFTNGP10.phx.gbl ...你好,
我想你可能会遗漏一个要点,
*驱动器头部只需
即可在任何给定时间访问硬盘的一部分。 />
我认为唯一不同的情况是,如果你要进行RAID设置。
尼克。
-
/ \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \\ \\ / \ / \ / \ / \ / \ / \ / \\ \\无论如何。无论结果如何,你都会被改变。
Fergus - 2003年9月5日
/ \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \
Hi,
I''m working on a little deployment app to support .Net file deployments to
about 7 different locations on the network. It''s somewhat intelligent in
that it only deploys changed files, and moves the old files to a backup
folder, so that most deployments can be done w/o booting all users off. The
network is pretty slow, so I built it so that each deployment (defined as
unique source/target folder combination) runs in a separate thread.
The issue I''m running into is that FileVersionInfo.GetVersionInfo seems to
either be running in a single thread below the surface, or have some other
issue with multithreading that I don''t understand. Each call is at least
twice as long and, at regular intervals, the CPU utilization hits 100% and
stays there for 15-20 secs, with more than 50% Kernel Time, whatever that
might imply. The end result is that the app runs just as slow as in a single
thread, except it''s even more annoying to watch.
The only obvious point of contention is that the threads may access the same
file in a source folder, but they are all local or on a fast connection, so
I can''t see how it would hang it for that long.
Does anyone know what the issue is and how I can fix it? Would a separate
AppDomain help? Process?
Thanks,
Magnus
Hi there,
I think you might be missing 1 main point,
* Only 1 part of the hard drive can be accessed at any given time by the
drive heads.
I think the only case that this would be different is if you were to
have a RAID setup.
Nick.
--
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
"No matter. Whatever the outcome, you are changed."
Fergus - September 5th 2003
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
Hi Magsnus,
I was thinking about it, and there where some things in my head.
But first a little question.
Is the throughput time from 7 simultaneous connections longer or is the sum
from the total processor time higher (That would be normal)?
Cor
I think Nak has this hit firmly on the head. Unless the network speed is
slower than the disk access/read/write speed, then that''s the answer.
OHM
"Nak" <a@a.com> wrote in message
news:Os**************@TK2MSFTNGP10.phx.gbl...Hi there,
I think you might be missing 1 main point,
* Only 1 part of the hard drive can be accessed at any given time by the drive heads.
I think the only case that this would be different is if you were to
have a RAID setup.
Nick.
--
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ "No matter. Whatever the outcome, you are changed."
Fergus - September 5th 2003
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
这篇关于FileVersionInfo.GetVersionInfo()在线程应用程序中的性能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!