Last active
February 4, 2020 08:53
-
-
Save turric4n/134d5bad5df18c8d9d3d7dba71528759 to your computer and use it in GitHub Desktop.
Delphi pararel chunk processing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var jobs := ['a'..'Z']; | |
var concurrent := 10; | |
chunksize := (High(jobs) + fconcurrent - 1) div fconcurrent; | |
for var t := 0 to High(jobs) do | |
begin | |
start := t * chunksize; | |
finish := Min(start + chunksize, High(jobs)); | |
task.process(jobs[t]); | |
end; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment