June 2016
Intermediate to advanced
470 pages
9h 49m
English
One of the first loops that any programmer starts to know is the for loop. In this recipe, we'll see a particular type of for loop: the parallel one. To be clear, this parallel for loop is not a new language feature but is a sort of it implemented as a static class method.
The parallel for loop is part of the Parallel Programming Library and is implemented by the TParallel class. Here's one of its (overloaded) versions and a utilization example:
//declaration class method TParallel.&For(ALowInclusive, AHighInclusive: Integer; const AIteratorEvent: TProc<Integer>): TLoopResult; //used as follows TParallel.&For(1,10, procedure(Index: Integer) begin //executed 10 times with index 1..10 end);
What is different about ...
Read now
Unlock full access