Java Concurrency: CAS vs Locking [closed]
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm reading the Book Java Concurrency in Practice . In chapter 15, they are talking about the nonblocking algorithms and the compare-and-swap (CAS) method. It is written that CAS perform much better than the locking methods. I want to ask the people who already worked with both of these concepts and would like to hear when you are preferring which one of these concepts? Is it really so much faster? For me, the usage of locks is much clearer and easier to understand and maybe even better to maintain (please correct me if I am wrong) . Should