开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜