I need to accomplish something like (and they have told me explain more with lots of words…)
static MyReturnObject Function1(myObjectA parameter1, myObjectB parameter2) {...}
static void Test()
{
Parallel.For( 0, 10, (index) =>
{
//create parameters y and z
x = Function1(y,z);
// Add x to an array
});
// Find the biggest x.
}
Code works but the result is not accurate. If i use “for” instead of “parallel.for”, i get accurate result.
I tried executing the code as per your rules and I am sure that it is possible to do the same.
Please find below code which I executed in an Winform application.