Make an Opaque IEnumerable Parallel Request (PLINQ)

In a function, I would like to do the parallel processing of IEnumerable, which is provided as an argument.

This IEnumerable is already the result of some chain ie:

IEnumerable argument = InitialEnumerable.Select(x => DoHeavyProcessing(x))...

But for me this is opaque - I cannot change the way this argument is created. I do not know how it is built.

Now, when I call the .AsParallel () argument, it does nothing good - AsParallel () only parallelizes the processing, which is on the right side, but all the work before that starts sequentially.

Instead, I need to somehow parse this IEnumerable and β€œdecorate” it so that the hard work is parallelized.

+3
source share
1 answer

. IEnumerable , , .

, IEnumerable, , .

+3

All Articles