Testing the script
Go ahead and launch this script and let's see how it works. Point your source directory at a folder full of large files, such as DVD images, archive files, or video files. Leave the threads' spin box at its default setting and click on Go.
Notice from the console output that the files are being hashed two at a time. As soon as one completes, another one starts until all of the files have been hashed.
Try it again, but this time bump the threads up to four or five. Notice that more files are being processed at once. As you play with this value, you may also notice that there is a point of diminishing returns, especially as you approach the number of cores in your CPU. This is an important lesson about parallelization—sometimes, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access