C# Parallel-ForEach - shared state

  • Thread starter Thread starter plepko1
  • Start date Start date
P

plepko1

Guest
My question is - can I modify the properties of any object inside a parallel loop?


Parallel.ForEach(myData.AsEnumerable()..., value =>
{
Object x = new Object();
x.A = ...;
x.B = ...; //Can I do this and is it safe?
}


Please help?

Continue reading...
 
Back
Top