Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

C# parallel for loop specify cores

ParallelOptions op = new ParallelOptions();
op.MaxDegreeOfParallelism = Environment.ProcessorCount / 2 ;
Parallel.ForEach(tokensFiles, op, filePath =>  DoSomething());
 
PREVIOUS NEXT
Tagged: #parallel #loop #cores
ADD COMMENT
Topic
Name
1+2 =