Optimize disk allocation for very large files.
What is the problem?
If I download a file of about 100 GB. And if the early rare piece is at the end of the sequence. It will take a very long time for the OS to write this piece.
To get around this problem, I propose the following algorithm.
If the requested piece is too far (optional) from the right of the last requested - request a new piece that satisfies the distance condition.