Results 1 to 9 of 9

Thread: Read from a single data file with multiple processors

  1. #1
    Join Date
    Mar 2010
    Posts
    136

    Read from a single data file with multiple processors

    Hi all, I want to know that if I am using a parallel code then is it possible that it can read from a Single data file from multiple processors? Can a single file can be accessed by different processes? And also tell me that if it can read from the same file independently? I have searched for this answer on internet but still not got any satisfactory answer. Is there anyone who has knowledge for this and can answer the question? Please provide the information as needed. Thanking you in advance.
    Last edited by Bayougoula; 22-09-2010 at 02:21 AM.
    www.techarena.in

  2. #2
    Join Date
    May 2008
    Posts
    835

    Re: Read from a single data file with multiple processors

    What do you want to ask actually. Do you want that all the threads to have coordinate access to the the same file or each thread should have individual access to that file and they are not concern with the other threads.If you want to do that you have to add synchronization primitive like mutex or critical section for reading. This will resist the simultaneous access to the file.

  3. #3
    Join Date
    Oct 2005
    Posts
    1,217

    Re: Read from a single data file with multiple processors

    I am agree with Amd Athlon that you have to synchronization primitive like mutex for critical section reading. Critical section is that where the same file is accessed from the different process simultaneously. Muter prevent the simultaneous access to file and for that it uses the Semaphore(S) to do that. This is nothing but a variable which is used to allow the access to the process. This is the basic concept that is use by Operating system to maintain the file access.

  4. #4
    Join Date
    Nov 2005
    Posts
    1,187

    Re: Read from a single data file with multiple processors

    Friends, I am running MPI parallel program which are running on dissimilar processors and each of them has their own memory. I need that all the processor should read the same file arbitrarily and separately. They can access the same file without distribution pointers. Multiple processors are nothing but the multiple programs and each of them has the same file access. This file will be opened by sharing.

  5. #5
    Join Date
    Sep 2005
    Posts
    1,434

    Re: Read from a single data file with multiple processors

    If any of your process is running many threads or we can say the multiple threads and each thread is sequentially reading the records from the file 1, 2, 3….and so on then each thread should have different unit and all the files should be opened with suitable SHARE. I think that it will give you the clear idea about the multiple processes.

  6. #6
    Join Date
    May 2008
    Posts
    1,205

    Re: Read from a single data file with multiple processors

    Yes, it is possible to open a file which is shared and we can read that file from different application or threads or processes but you have to make sure that the file access is your bottleneck.Once I did the task of writing the data conversion on a file which is more than 7 GB then on the starting it take time in hours to complete but at the end it takes only few seconds that means that it takes more time to submit the data to the database. Stringbuilder object gives me the highest performance.

  7. #7
    Join Date
    May 2009
    Posts
    979

    Re: Read from a single data file with multiple processors

    If you have a large text file on your hard drive and you are feeling that your CPU processing is very slow then I don’t think that the multiple threads are going to help you or multiple threads are going to force your hard drive to spin faster and improve the performance. I am not very sure about it but it is the one what I know.

  8. #8
    Join Date
    May 2009
    Posts
    1,010

    Re: Read from a single data file with multiple processors

    I think you want to say that the hard disk is a bottleneck and it supplying the data as fast as it can supply. If you create multiple threads to access the files then it will make the process slower because if you do that then you are forcing your hard drive to jump from one process to other to satisfy the requests from the process. And moving the hard disk to the processes takes time and makes the process slow.

  9. #9
    Join Date
    May 2009
    Posts
    1,070

    Re: Read from a single data file with multiple processors

    If you are not programming the multiple processes then I don’t think that the threads will help you because the critical path of your application seems to be to totally process the file. Threads cannot run at the same time because when one of the threads is executing then others have to wait till its execution time and after it finishes the work then the next in the queue will start executing.

Similar Threads

  1. Maintain single (large) file or split into multiple schedules?
    By m_albiges in forum Microsoft Project
    Replies: 4
    Last Post: 12-05-2013, 06:38 PM
  2. Scan multiple pages to single file on hp photosmart 6510
    By Non-$ensoi in forum Hardware Peripherals
    Replies: 1
    Last Post: 08-05-2012, 07:38 PM
  3. Encoding multiple lines of data into single line
    By rajkrishna89 in forum Software Development
    Replies: 3
    Last Post: 04-10-2011, 02:01 AM
  4. how to read data from file using c++ program?
    By Juaquine in forum Software Development
    Replies: 5
    Last Post: 27-02-2010, 06:02 PM
  5. Merge multiple PDF files in single PDF file
    By Steinbach in forum Tips & Tweaks
    Replies: 2
    Last Post: 19-03-2009, 11:20 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,192,385.00078 seconds with 16 queries