How to increase parallel parallel tasks using System.Threading.Parallel (.Net 4.0)

I am experimenting with new System.Threading.Parallel methods such as parallel for and foreach.

They seem to work well, but I need a way to increase the number of concurrent threads running, which are 8 (I have a Quad core).

I know that there is a way that I can just find the place where you hid your damn property.

Gilad.

+3
source share
3 answers

quote:

var query = from item in source.AsParallel().WithDegreeOfParallelism(10)
        where Compute(item) > 42
        select item;

, , , File I/O, parallelism , .

from: MSDN

+6

Parallel.For Parallel.ForEach, ParallelOptions, MaxDegreesOfParallelism. , , , . WithDegreeOfParallelism . .

+4

- .

0

Source: https://habr.com/ru/post/1727058/


All Articles