(let's assume I have 10 cores)
When I write:
Parallel.For(0, 100, (i,state) =>
{
Console.WriteLine(i);
});
Questions:
What is the formula of assigning amount of numbers to each core? (is it
100/10
?)At execution point, does each core already know which numbers is is gonna handle? Or does it consume each time a new number/s from the
[0..100]
repository (let's ignore chunk or range for now)?The
i
parameter - does it refer to the0..100
index or is it a relative index in each thread and its "gonna handle" numbers?