Brief introduction to AbstractQueuedSynchronizer by Using a Simple Mutex Example

Written by eric.liu.developer | Published 2017/06/04
Tech Story Tags: programming | java | java-concurrency | doug-lea | mutex

TLDRvia the TL;DR App

AbstractQueuedSynchronizer is a masterpiece java class authored by Doug Lea. It is the underlying data structure that provides the acquire, tryAcquire, release, tryRelease … interface to CountDownLatch, Semaphore, ReentrantLock, and ReadWriteLock. So AbstractQueuedSynchronizer is basically the backbone of java.util.concurrent package.

I did a short presentation on AQS and try to explain how the simple acquire and release work, hope you will enjoy it.

Here is the code of the Mutex implemented using AQS:

In this video, I explained how this class works and the underlying mechanisms in AQS.


Published by HackerNoon on 2017/06/04