C# Multithreading accessing single method
I need to process 60000 files in a single shot using a method. How can use threading to increase the performance and lower the processing time. If I use multiple threads which access the same method, will it throw error? Can you give me a sa开发者_开发百科mple how to process it.
Where are the 60000 files? All in one folder on a local hard disk/SSD or spread out on mutiple disks/LAN servers? If the're all local, there may be not much to gain by parallel processing, (there will be some, but is the gain worth the complication?). If the files span disks/servers, then there is potentially a huge performance boost available.
Rgds, Martin
Here is a Microsoft tutorial with explanations and samples on coding a multithreaded project. http://msdn.microsoft.com/en-us/library/aa645740%28v=vs.71%29.aspx
精彩评论