Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 769197
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T18:17:53+00:00 2026-05-14T18:17:53+00:00

I have about 1500 files on a share for which I need to collect

  • 0

I have about 1500 files on a share for which I need to collect FileVersionInfo string. So I created a Static method in my Gateway like this:

private static string GetVersionInfo(string filepath)
{
    FileVersionInfo verInfo = FileVersionInfo.GetVersionInfo(filepath);
    return string.Format("{0}.{1}.{2}.{3}", verInfo.ProductMajorPart, verInfo.ProductMinorPart,
                                            verInfo.ProductBuildPart, verInfo.ProductPrivatePart).Trim();
}

And then used FileAndVersion struct in a PLINQ call with DegreeOfParallelism as this is I/O related

resultList = dllFilesRows.AsParallel().WithDegreeOfParallelism(20)
                    .Select(r =>
                    {
                        var symbolPath = r.Filename;
                        return new FilenameAndVersion{Filename=symbolPath, Version=GetVersionInfo(symbolPath)};
                    })
                    .ToArray();

Later I modified the Struct, FileAndVersion as:

 private struct FilenameAndVersion 
{
    private string _version, _filename;
    public string Version { get { return _version; } }
    public string Filename { get { return _filename; } }

    private void SetVersion()
    {
        FileVersionInfo verInfo = FileVersionInfo.GetVersionInfo(this.Filename);
        this._version = string.Format("{0}.{1}.{2}.{3}", verInfo.ProductMajorPart, verInfo.ProductMinorPart,

                                                                                    verInfo.ProductBuildPart, verInfo.ProductPrivatePart).Trim();
}
public FilenameAndVersion(string filename, string version)
{
    this._filename = filename;
    this._version = string.Empty;
    SetVersion();
}

}

And used it:

resultList = dllFilesRows.AsParallel().WithDegreeOfParallelism(20)
                    .Select(r =>
                    {
                        var symbolPath = r.Filename;
                        return new FilenameAndVersion(symbolPath, String.Empty);
                    })
                    .ToArray();

The question is, is this going to help me in anyway and is a good pattern to use ?
Forgot to mention that the files are on a server that has RAID 10 with SAN attached to it.

Sunit

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T18:17:53+00:00Added an answer on May 14, 2026 at 6:17 pm

    If all of your files are on the same disk, doing it in parallel isn’t going to help at all. A disk can only read one thing at a time, so you would probably be better of forgetting about parallelism it, ditch the threading overhead and just let it run sequentially.

    All you are going to end up with if you run this in parallel is a disk that just thrashes about all over the place and ends up reading slower overall.

    If you files are on different physical drives, (or are over a network like FTP), then consider taking a bit more control of the parallelism and dividing it into a single task for each physical disk.

    My advice would be to benchmark it before you make any firm commitment to making something parallel.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have about 1500 images within a folder named 3410001ne => 3809962sw. I need
I have about 1500 items in an Open Office CSV file like this: <a
I'm using WinForms NET 2.0 in C#. I have text files, of about 1000-1500
I have two tables, one has about 1500 records and the other has about
I have some question about functions which have default parameters. import sys from random
I am designing a Web application that we estimate may have about 1500 unique
I have a list of about 1500 strings from an external database and over
I have a search in solr that is returning about 1500 documents. These documents
I have this legacy code base (Compaq PERL) , about 1500 lines of code,
I have a list of about 1500 part numbers in an Excel document. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.