Brief introduction to AbstractQueuedSynchronizer by Using a Simple Mutex Example by@eric.liu.developer

Brief introduction to AbstractQueuedSynchronizer by Using a Simple Mutex Example

ericliu Hacker Noon profile picture

ericliu

Software Developer

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.

Tags

Join Hacker Noon

Create your free account to unlock your custom reading experience.