I need set the number of processor's threads for parallel "for-loop". I want work with only 3 threads of 8 (4-cores processor) ..... Now I'm using all 8 threads.
System.Threading.Tasks.Parallel.For(0, exponentstring.Length, (i, loopState) =>
{
int y = my_function (a, exponent[i], modulo);
string str = y.ToString();
if (str == numbers[0])
{
loopstop = 1;
loopState.Stop();
}
});
Thanks for your ideas.