Hunting and Defeating Concurrency Bugs at Machine Speed
- Preface: Why Sequential Tests Lie
- Table of Contents
- About This Book
Part I — Foundations of Concurrency & Memory Visibility
- 1. The Foundations of Java Threads
- 2. Memory Visibility and Safe Initialization
- 3. CPU False Sharing and Cache Coherence
Part II — Shared Types & Thread Safety
- 4. The Shared Collection Trap
- 5. Silent Corruption in Core JVM Types
- 6. ThreadLocal Leaks and Contamination
Part III — Coordination, Locking & Deadlocks
- 7. Lock Contention and Lock Hygiene
- 8. Dangerous Synchronization Patterns
- 9. Deadlocks, Livelocks, and Lock Order Violations
- 10. Low-Level Thread Coordination
Part IV — Modern Async Pipelines & Fork-Join
- 11. Synchronizers: Phasers, Semaphores, and the Over-Synchronization Trap
- 12. CompletableFuture Exception Traps
- 13. Async Pipeline Throughput and Back-Pressure
- 14. Thread Starvation and Pool Deadlocks
Part V — Project Loom & The Virtual Thread Era
- 15. Executor Lifecycle: Shutdown Leaks and Scheduling Traps
- 16. Project Loom: Virtual Thread Realities and Pinning
- 17. Scope Management: ScopedValue and Structured Concurrency
Part VI — Concurrency Hygiene & Operations
- 18. Cooperative Cancellation and the Interrupt Contract
- 19. Operational Hygiene: Initialization, Memory, and Test Purity
- 20. The ARM Memory Frontier
- 21. The FFM Confinement Trap
- 22. The Reactive-Loom Bridge
- 23. StructuredTaskScope as Policy
Appendix
- A. Quick-Start Guide to @AsyncTest
- B. Concurrency Anti-Pattern Reference
- C. Platform Coverage Matrix
Back Matter
- The Async Java Manifesto
- Conclusion: The Trap Was Never Hidden
- Epilogue: What This Book Did Not Cover
- About the Author
- Glossary
- References
