C# parallel for loop specify cores code example
Example: C# parallel for loop specify cores
ParallelOptions op = new ParallelOptions();
op.MaxDegreeOfParallelism = Environment.ProcessorCount / 2 ;
Parallel.ForEach(tokensFiles, op, filePath => DoSomething());