Is it useful to use multithreading to process files on your hard drive?

In terms of performance and execution speed, is it useful to use multithreading to process files on hard drives? (move files from disk to another disk or check file integrity)

I think it's mainly the speed of my hard disk that determines my treatment speed

Solution

Multithreading can help, at least sometimes The reason is that if you are writing a "normal" hard drive (e.g. not a solid-state drive), the thing that slows you down most is the seek time of the hard drive (that is, the time it takes) the hard drive to reposition its read / write head from one distance to another within the disk radius Compared with other parts of the system, this movement is very slow, and the time required for the head to find is proportional to the distance it must travel So, for example, the worst case scenario is if the head must move from the edge of the disk to the center of the disk after each operation

Of course, the ideal solution is to make the head never look, or rarely look. If you can arrange it so that your program only needs to read / write one file in order, it will be the fastest Or even better, when switching to an SSD without a head, the seek time is actually zero

The above is what programming house collects and arranges for you. Is it useful to use multithreading to process files on the hard drive? I hope this article can help you solve whether it is useful to use multithreading to process files on the hard drive? Program development problems encountered.

If you think the content of the programming home website is good, you are welcome to recommend the programming home website to programmers and friends.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>