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

  • Home
  • SEARCH
  • 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 6157333
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:46:04+00:00 2026-05-23T20:46:04+00:00

Please look at the code below. void func() { for(;;) { var item =

  • 0

Please look at the code below.

void func()
{
    for(;;)
    {
        var item = new Item();
    }
}

Item is a class in whose constructor I read several csv files, as follows

List<string> data = new List<string>();
Item()
{
    //read from csv into List<string>data
}

As is visible, the csv files are distinct and are read into unique variables. I would like to be able to parallelize this. All my data is on a network drive. I understand that the limitation in this case is the disk access. Can someone suggest what I can do to parallelize this?

  • 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-23T20:46:04+00:00Added an answer on May 23, 2026 at 8:46 pm

    As stated before Parallel.ForEach is the easiest way to run something in parallel, but if I recall correctly parallel.ForEach is a .net 4 method. so if you are using a different version you will have to find another method that uses locks.

    If you are looking to read in data from a csv, ADO.net has a built in function that can read in csv files based on a schema file, it’s one of the fastest ways in my experience to read in csv files.

    quick link I found from google
    http://www.daniweb.com/web-development/aspnet/threads/38676

    I’ve also had great success with this http://www.codeproject.com/KB/database/CsvReader.aspx . It’s a little slower than the ado.net version but it’s easier to use and you don’t need schema file.

    just a warning, if you use the ado.net and you large string numeric values like credit cards numbers and you are getting things that look like scientific notation, your schema file needs to be adjusted, I’ve had a lot of coders complain about this.

    happy coding.

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

Sidebar

Related Questions

Please look at simple code below public class A{} public class B: A{} public
Please look at the code below and suggest the best approach. I can't quite
Please have a look on code written below. I am trying to have a
Please have a look at my code below. It's not working and I don't
First, please look at this custom Button-inherited UserControl code: Public Class UserControl1 Dim _Text
Please have look on the following code: $_SESSION[process_y] = new Process(); $process_y = $_SESSION[process_y];
Please take a look at the html listed below and let me know why
Getting the above error in following code. How to rectify it. Thanks. Please look
I have just started to look at .NET 3.5 so please forgive me if
Please read the whole question. I'm not looking for an approach to managing multi-lingual

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.