113

尝试Java加锁新思路:原子变量和非阻塞同步算法 - 简书

 6 years ago
source link: http://www.jianshu.com/p/377666236271?
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
进年以来,并发算法领域的重点都围绕在非拥塞算法,该种算法依赖底层硬件对于原子性指令的支持,避免使用锁来维护数据一致性和多线程安全。非拥塞算法虽然在设计上更为复杂,但是拥有更好的可伸缩性和性能,被广泛应用于实现计数器、序列发生器和统计数据收集器等 1. 锁的劣势 前文中曾经对比同步方法的内置锁相比和显式锁,来说明它们各自的优势,但是无论是内置说还是显式锁,其本质都是通过加锁来维护多线程安全。 ...

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK