44

从 synchronized 到 CAS 和 AQS - 彻底弄懂 Java 各种并发锁-java架构师1的博客

 5 years ago
source link: http://blog.51cto.com/13981400/2344209
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.
概述Java中的并发锁大致分为隐式锁和显式锁两种。隐式锁就是我们最常使用的synchronized关键字,显式锁主要包含两个接口:Lock和ReadWriteLock,主要实现类分别为ReentrantLock和ReentrantReadWriteLock,这两个类都是基于AQS(AbstractQueuedSynchronizer)实现的。还有的地方将CAS也称为一种锁,在包括AQS在内的很多并

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK