Concurrent reading of a File (java preferred)

后端 未结 4 771
醉话见心
醉话见心 2020-12-08 02:51

I have a large file that takes multiple hours to process. So I am thinking of trying to estimate chunks and read the chunks in parallel.

Is it possible to to concurr

4条回答
  •  盖世英雄少女心
    2020-12-08 03:36

    If you're reading a file from a hard drive, then the fastest way to get the data is to read the file from start to end, that is, not concurrently.

    Now if it's the processing that takes time, then that might benefit from having several threads processing different chunks of data concurrently, but that has nothing to do with how you're reading the file.

提交回复
热议问题