[fpc-devel] Xe3 Parallel for

Michael Schnell mschnell at lumino.de
Tue May 12 11:43:44 CEST 2015


Seemingly Xe3 provides a parallel loop feature to support fast 
multi-Core applications

------------------------------------------------------------------------

     try
     // counts the prime numbers below a given value
       Tot:=0;
       SW:=TStopWatch.Create;
       SW.Start;
       TParallel.For(2,1,Max,procedure(I:Int64)
       begin
         if  IsPrime(I)  then
          TInterlocked.Increment(Tot);
       end);
     SW.Stop;
      Memo1.Lines.Add(Format('Parallel For loop. Time (in milliseconds): %d - Primes found: %d',  [SW.ElapsedMilliseconds,Tot]));
     except  on  E:EAggregateExceptiondo
      ShowMessage(E.ToString);
     end;

------------------------------------------------------------------------

So they did not use the Prism syntax ("parallel for" / "future"), but (again) introduced something new incompatible to everything.

Will fpc follow ?

-Michael




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20150512/08b6b354/attachment.html>


More information about the fpc-devel mailing list