Suppose I have two threads: A and B. When A creates an object(for example a List of String), and passes it to B for processing. Will there a performance decrease for each time B access this object? Or will there be a one-time penalty while the object is marshalled from A to B?
Share
There is no marshalling between threads in .NET. Both threads will interact with the same memory for storage associated with the object. There is no performance overhead for having one thread rather than another perform an operation on the object.
You need to worry about synchronisation between threads to ensure thread safety, not performance.