Is it possible to have a parallel for each loop for items in the queue so that it:
EDIT: This applies to System.Threading.Tasks Parallel.ForEach functions
Subscribe to the queue using Reactive Extensions and complete each item in a new task. You do not have to block or wait for a new element, as it will be placed in your lambda of your subscription, and your processing / processing will be parallel.
http://rxwiki.wikidot.com/101samples
BlockingCollection :
var bc = new BlockingCollection<int>(); Task.Factory.StartNew(() => { ParallelOptions options = new ParallelOptions { MaxDegreeOfParallelism = 30 }; Parallel.ForEach(bc.GetConsumingEnumerable(), options, i => { }); });
, , , .
, /. , , .Net. , .Net, concurrency , Microsoft Robotics. , .
, , Google .