Thread safety for parallel tasks in .NET.

Are the internal delegate elements in the thread of the parallel task library safe - i.e. is the value of the variable declared inside this delegate allocated for this thread?

Example:

Parallel.ForEach(collection, item => {
    var something = new Something(item.Property);
});

Is it somethingguaranteed to always be unique to a thread, protected from being overwritten by another thread created by the same operation Parallel?

+3
source share
1 answer

something - , , -, - , , (, , )

+5

All Articles