Copy the reference of an object or pass it in a method/constructor is thread safe?
开发者_JS百科I have an object that is shared in read/write between threads.
Assuming that the synchonization is correctely done, if A is the object previously initialized when no threads are running, when they start working is thread-safe do:
Object B = A;
DoSomething(A);
?
References can safely be shared; however, access to the actual object may require synchronization.
精彩评论