Reading a single file with Multiple Thread: should speed up?

后端 未结 3 437
孤独总比滥情好
孤独总比滥情好 2020-12-06 18:57

I\'m reading a file which conatins 500000 rows. I\'m testing to see how multiple thread speed up the process....

private void multiThreadRead(int num){

             


        
3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-06 19:22

    Since file reading is mainly waiting for disk I/O, you have the problem that the disk won't spin faster just because it's used by many threads :)

提交回复
热议问题