开发者

volatile vs. synchronize, which one for objects? [duplicate]

This question already has answers here: Closed 11 years ago.

Possible Duplicates:

Difference between volatile and synchronized in JAVA (j2me)

Difference between synchronization of field reads and volatile

According to java documentations, I f开发者_如何学Goound volatile works like synchronized about objects. I was wondering if volatile is faster than synchronized or not? or it would cause any side effect to use volatile instead of synchronized keyword?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜