Java Concurrency: Deep Dive
Eight posts on java.util.concurrent, each built from small Java programs actually compiled and run, showing a real behavioral contrast rather than an API tour: executors and thread pools, Future/CompletableFuture, CountDownLatch/CyclicBarrier, Semaphore, synchronized vs ReentrantLock, ReadWriteLock/StampedLock, atomics, and BlockingQueue.
- Executors & Thread Pools: What Actually Happens to Queued and Interrupted Tasks (Part 1 of 9)
- Future, Callable, CompletableFuture: Blocking, Timing Out, and Not Blocking At All (Part 2 of 9)
- Coordinating Threads: CountDownLatch & CyclicBarrier (Part 3 of 9)
- Limiting Concurrency: Semaphore (Part 4 of 9)
- Explicit Locks: synchronized vs ReentrantLock (Part 5 of 9)
- ReadWriteLock & StampedLock: Concurrent Reads, and When an Optimistic Read Fails (Part 6 of 9)
- Atomics: AtomicInteger vs a Plain Counter, and a CAS Loop Actually Retrying (Part 7 of 9)
- BlockingQueue: Producer/Consumer with ArrayBlockingQueue and SynchronousQueue (Part 8 of 9)
- Deadlock: Reproducing It, Detecting It, and Two Ways to Avoid It (Part 9 of 9)