c# - What is the difference between EnumerablePartitionerOptions.NoBuffering and not using Partitioner at all? -
in case have collection of objects each object's process takes lots of time, difference between enumerablepartitioneroptions.nobuffering , not using partitioner @ all?
enumerablepartitioneroptions.nobuffering:
create partitioner takes items source enumerable 1 @ time , not use intermediate storage can accessed more efficiently multiple threads. option provides support low latency (items processed available source) , provides partial support dependencies between items (a thread cannot deadlock waiting item thread responsible processing).
thank you.
update: faster? , why?
ienumerable<int> numbers1 = enumerable.range(1, 100); parallel.foreach(numbers1, (number1) => veryexpensivemethod(number1)); // // partitioner<int> numbers2 = partitioner.create(enumerable.range(1, 100), enumerablepartitioneroptions.nobuffering); parallel.foreach(numbers2, (number1) => veryexpensivemethod(number1));
Comments
Post a Comment