Archive Post

Reentrant Read-Write Lock 2 – Concurrency: Part II

In Example 23.13, the class ReentrantRWLockCounter implements a thread-safe counter using a ReentrantReadWriteLock. It is…

Reentrant Read-Write Lock – Concurrency: Part II

Reentrant Read-Write Lock The explicit lock implemented by the ReentrantLock class is mutually exclusive—that is,…

Special-Purpose Synchronizers – Concurrency: Part II

23.5 Special-Purpose Synchronizers The java.util.concurent package provides classes that implement useful special-purpose synchronization idioms that…

Special-Purpose Synchronizers 2 – Concurrency: Part II

Example 23.14 illustrates using a single cyclic barrier that is shared by three threads. The…

Count-Down Latch – Concurrency: Part II

Count-Down Latch The java.util.concurrent.CountDownLatch class implements a count-down latch that allows one or more threads…

Synchronized Collections and Maps – Concurrency: Part II

23.6 Synchronized Collections and Maps The primary goal of the Collections Framework is to provide…

Serial Access – Concurrency: Part II

Serial Access In order to guarantee thread-safety, all access to elements of the underlying collection…

Compound Mutually Exclusive Operations – Concurrency: Part II

Compound Mutually Exclusive Operations A compound operation that requires multiple operations on a synchronized collection…