Chapter 4Scalability and Thread Safety

I don’t know, it all happened so fast.

Turtle mugged by a gang of snails

If you started programming in Java in the last century like I did, you’ve endured the multithreading and collections API that shipped with earlier Java versions. It handles threads and provides thread safety but doesn’t quite consider performance or scalability. Even though threads are relatively lightweight, it takes time and resources to create them. Also, thread safety is provided at the expense of scalability—overly conservative synchronization limits performance.

So, even though it’s been around the longest and is still available, the old threading API is not the right choice if we want maintainable code with better scalability ...

Get Programming Concurrency on the JVM now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.