Use MultiThreading to read a file faster

后端 未结 3 1344
忘了有多久
忘了有多久 2020-12-06 15:43

I want to read a file of 500 Mb with the help of 2 threads, so that reading the file will be much faster. Someone please give me some code for the task using core java conce

3条回答
  •  死守一世寂寞
    2020-12-06 16:30

    Multi-threading is not likely to make the code faster at all. This because reading a file is an I/O-bound process. You will be limited by the speed of the disk rather than your processor.

提交回复
热议问题