Whole-book reading guide from stratified index samples; jump to passages in the text
Tip the Site
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat Pay
Alipay
Open WeChat or Alipay and scan. No login required.
AI guide
【One-Line Pitch】
A source-level tour of how Java concurrency actually works under the hood, tracing the JDK's Concurrent package from memory visibility and CAS up to thread pools and CompletableFuture. Best for Java developers who already write multithreaded code and now want to understand *why* it behaves the way it does.
【Book Arc】
- **Opening (~0%–17%)**: Establishes the concurrency foundations — why `interrupt()`/`InterruptedException` are misunderstood, how `synchronized` maps onto the object header's Mark Word, the producer–consumer model, and the memory-visibility and reordering problems (volatile, DCL, final, memory barriers).
- **Early (~17%–33%)**: Moves into the atomic layer — `AtomicInteger`/`AtomicLong`, how `boolean`/`double` are supported via `Unsafe` CAS, field updaters, and the pseudo-sharing / cache-line padding problem behind `LongAdder` and `LongAccumulator`.
- **Middle (~33%–50%)**: The heart of the book: AQS-based lock internals — the four core elements of a blocking lock, fair vs. non-fair acquisition, read-write locks, `Condition`, and `StampedLock`'s optimistic read.
- **Late (~50%–83%)**: Concurrent collections and pools — `CountDownLatch`, blocking queues (`ArrayBlockingQueue`, `PriorityBlockingQueue`, `BlockingDeque`), `ConcurrentLinkedQueue`, `ConcurrentHashMap` across JDK 7 and 8, skip lists, then thread pools, `Future`, and `ForkJoinPool` work-stealing.
- **Ending (~83%–100%)**: Async composition — `CompletionStage` chaining, `thenCompose`/`thenCombine`, `CompletableFuture` internals on `ForkJoinPool`, and how dependent tasks form a directed acyclic graph.
【Key Takeaways】
- **Memory visibility is "eventually visible," not "invisible"** (Opening): a write may not be seen immediately by another thread, which breaks lock-free algorithms — `volatile` and memory barriers are the fix.
- **Reordering is governed by as-if-serial semantics** (Opening): compilers and CPUs may reorder freely within a thread but not across threads, which is exactly why DCL singletons need `volatile`.
- **Every Java object can act as a lock** (Opening): `synchronized` works because lock state lives in the object header's Mark Word, a design pattern reused later by `ReentrantLock`.
- **A blocking lock needs four ingredients** (Middle): a CAS-managed `state`, an owner record, OS-level park/unpark, and a thread-safe wait queue — the AQS blueprint.
- **`state` doubles as a reentrancy counter** (Middle): incrementing on each `lock` and decrementing on each `unlock` is how reentrant locks are tracked.
- **Pseudo-sharing silently kills throughput** (Early): cache lines are the unit of invalidation, so unrelated variables sharing a line cause false invalidation — addressed via `@Contended` padding in `LongAdder`.
- **`ConcurrentHashMap` changed fundamentally between JDK 7 and 8** (Late): segment-based locking gave way to per-bucket `synchronized` plus red-black trees and cooperative resizing.
- **`CompletableFuture` builds a DAG, not a chain** (Ending): each future holds a Treiber stack of dependents, enabling And/Or fan-in and fan-out across tasks.
【Reading Tips】
- Deep-read the AQS and `ConcurrentHashMap` chapters — they are the conceptual spine the rest of the book hangs on.
- Skim the early atomic-class material if you already know CAS; return to it only for the pseudo-sharing discussion.
- Keep the JDK source open alongside the book; the value is in matching prose to actual code paths.
- Treat the thread-pool and `ForkJoinPool` chapters as practical reference — the `ctl` bit layout and work-stealing logic repay careful reading.
- Don't expect API tutorials; this is an internals book, so bring working familiarity with `synchronized`, `Lock`, and executors.
【Coverage Limits】
This guide is synthesized from stratified excerpts covering the book's full arc, but individual chapter details (especially later chapters) are only partially represented; some specific code examples and figures are not reflected here.
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.
Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat PayAlipay
Open WeChat or Alipay and scan. No login required.
Add Tag
Enter tag name (max 50 characters)
Share E-Book
Java并发实现原理:JDK源码剖析 (余春龙 著)(Z-Library)
Scan QR code with your phone to access
Copy the link or scan the QR code to access this e-book on your phone
Share to WeChat Moments
Java并发实现原理:JDK源码剖析 (余春龙 著)(Z-Library)
Scan the QR code with WeChat to open this book
Tap the ··· menu in the top-right corner
Choose Share to Moments
You are already in WeChat. Tap ··· in the top-right corner and choose Share to Moments.
Share E-Book via Email
Please enter email address
Donation Statistics
¥.00
Total Donations
0
Donation Count
Java并发实现原理:JDK源码剖析 (余春龙 著)(Z-Library)
Find Your Favorite Books
Only registered users can comment after logging in. Comments need to be reviewed by administrators before being displayed
Loading comments...
Reply to Comment
Edit Comment