6
votes
Vote UpVote

Parallel.ForEach.Aggregate

The Delphi Geek – Totally out-of-band posting (I’m still working on the second part of the “blocking collection” trilogy), posted just because I’m happy that the code works. This code. procedure TfrmParallelAggregateDemo.btnCountParallelClick(Sender: TObject);var numPrimes: integer;begin numPrimes := Parallel.ForEach(1, inpMaxPrime.Value) .NumTasks(inpNumCPU.Value) .Aggregate(procedure (var aggregate: TOmniValue; const value: TOmniValue) begin aggregate.AsInteger := aggregate.AsInteger + value.AsInteger; end) .Execute(function (const value: TOmniValue): TOmniValue begin if ...
Favorite? Off-Topic? gabr @ 2010-02-01 19:52

Statistics

Visits: 500
Votes: 6
Favorites: 0
Off-Topic: 0

Visits by Source

User Actions

Users who voted for this posting

Alister Christie
Francis Ruiz
jamiei
knight_killer
Primoz Gabrijelcic
runner
Subscribe:
Contact us to advertise on DelphiFeeds.com

Community Links

Torry Firebird News

Sponsor

 
Please login or register to use this functionality.
(click on this box to dismiss)