Using Parallel.ForEach to calculate intersections (brep- curve)

Hello everyone, I hope you are all safe and well.

I’m writing a small app to calculate different intersections.
I wrote this nested Parallel.ForEach (I read an article that it is possible). The code works in terms of speed, but the outcome results are not consistent. It’s looks like both loops are not synchronized at some point. This is what I’m guessing.
I know It’s more like a coding question than a Rhino one. But… any clue or idea that could help me would be extremely helpful.

  Parallel.ForEach(arrSight, (lnSegment) =>
            {
                c = 0;
                Parallel.ForEach(arrBreps, (b) =>
                {
                    if (Rhino.Geometry.Intersect.Intersection.CurveBrep(lnSegment, b, doc.ModelAbsoluteTolerance, doc.ModelAngleToleranceDegrees, out t))
                    {
                        if (t.Length > 0)
                        {
                            c++;
                        }
                    }
                });
                if (c > 0)
                {
                    i++;
                }
            });

Thanks, in advance
have wonderful day.
Carlos.