Vote UpVote

Three steps to the blocking collection: [1] Inverse semaphore

The Delphi Geek – In What’s new for the coordination data structures in Beta 2? Joshua Phillips published following algorithm demonstrating a use of BlockingCollection in Parallel Extensions Beta 2. var targetNode = …; var bc = new BlockingCollection<Node>(startingNodes); // since we expect GetConsumingEnumerable to block, limit parallelism to the number of // procs, avoiding too much thread injection var parOpts = new ParallelOptions() { MaxDegreeOfParallelism = Enivronment.ProcessorCount }; Parallel.ForEach(bc.GetConsumingEnumerable(), parOpts, (node,loop) => { ...
Favorite? Off-Topic? gabr @ 2010-01-07 17:57


Visits: 346
Votes: 2
Favorites: 0
Off-Topic: 0

Visits by Source

User Actions

Users who voted for this posting

Charles Ardour
Contact us to advertise on DelphiFeeds.com

Community Links

Torry Firebird News


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