A user has asked me about the possibility of introducing "parallelism" to my program, so that multiple CPU power can be used to analyse a single object (files, typically).
In my case, my program computes hashes of files typically using the FPC hash library and sometimes the DCPCrypt library for larger algorithms. Having done some reading, I notice there are wiki entries for "multi-threading" and "parallelism" - one seems to relate more to program responsive and the latter appears to relate more to computational speed. I'm curious to know just how feasible such a concept is when using the FPC hash libraries?
For example, the following computes a hash of a file in my program currently :
var
GeneratedHash : string;
begin
GeneratedHash := MD5Print(MD5File( OpenDialog.Filename));
end;
Lets say that file is 1Tb is size, then the program is unresponsive until MD5Print returns the computed value. That issue might benefit from multithreading, and though desirable, is not key to the issue. More significantly is whether it is possible to speed up the process by splitting the task between available CPUs. Is it even possible to say "CPU1 compute 250Gb of the file, CPU2 250Gb of it, CPU3 250Gb of it, CPU4 250Gb of it"?