Adventures with concurrent programming in Java: A quest for predictable latency
summary
Shows why common Java queues and condition variables cost real latency (90th percentile ≈ 8 microseconds, worst > 5.5 milliseconds), and demonstrates concrete alternatives: replace blocking put/take with nonblocking offer/poll, use a concurrent linked queue or a ring-buffer (disruptor → disruptor 3) to drop a real system from ~80µs to ~50µs, and for heavy multi-producer IPC use lock‑xadd and a many-to-one ring buffer to avoid CAS spin loops and achieve far lower, more predictable latency on Java 8/i7 hardware.
AI-written summary · about
chapters (15)
- 0:00Introduction to latency
- 7:01Measuring blocking in systems
- 9:06Causes of application blocking
- 12:12Defining latency and SLA
- 16:01Why blocking pauses matter
- 19:51Queue implementation costs
- 24:08Benchmarking queue performance
- 31:51Real-world queue requirements
- 32:36Disruptor ring buffer design
- 37:28Lamport queue alternatives
- 41:42Inter-process communication
- 46:14High-performance IPC design
- 52:58IPC benchmark results
- 55:03Java vs C++ performance gaps
- 1:00:46Future of Java concurrency
