Jump to ratings and reviews
Rate this book

Programming Concurrency on the JVM: Mastering Synchronization, STM, and Actors

Rate this book
More than ever, learning to program concurrency is critical to creating faster, responsive applications. Speedy and affordable multicore hardware is driving the demand for high-performing applications, and you can leverage the Java platform to bring these applications to life. Concurrency on the Java platform has evolved, from the synchronization model of JDK to software transactional memory (STM) and actor-based concurrency. This book is the first to show you all these concurrency styles so you can compare and choose what works best for your applications. You'll learn the benefits of each of these models, when and how to use them, and what their limitations are. Through hands-on exercises, you'll learn how to avoid shared mutable state and how to write good, elegant, explicit synchronization-free programs so you can create easy and safe concurrent applications. The techniques you learn in this book will take you from dreading concurrency to mastering and enjoying it. Best of all, you can work with Java or a JVM language of your choice - Clojure, JRuby, Groovy, or Scala - to reap the growing power of multicore hardware. If you are a Java programmer, you'd need JDK 1.5 or later and the Akka 1.0 library. In addition, if you program in Scala, Clojure, Groovy or JRuby you'd need the latest version of your preferred language. Groovy programmers will also need GPars.

298 pages, Paperback

First published July 28, 2011

20 people are currently reading
241 people want to read

About the author

Venkat Subramaniam

21 books71 followers
Dr. Venkat Subramaniam, founder of Agile Developer, Inc., has trained and mentored thousands of software developers in the US, Canada, Europe, and Asia. Venkat helps his clients effectively apply and succeed with agile practices on their software projects. He is a frequent invited speaker at international software conferences and user groups. He's author of .NET Gotchas (O'Reilly), coauthor of the 2007 Jolt Productivity award-winning book Practices of an Agile Developer (Pragmatic Bookshelf), and author of Programming Groovy (Pragmatic Bookshelf).

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
26 (21%)
4 stars
56 (46%)
3 stars
37 (30%)
2 stars
1 (<1%)
1 star
0 (0%)
Displaying 1 - 11 of 11 reviews
Profile Image for Nathan Brodsky.
15 reviews13 followers
September 30, 2019
Appeared to be very easy to read, simple to understand and straightforward to form an overall picture in the head book about software architecture. A lot of wisdom, good examples, CLEAR structure. This book is good for a wide range of audience. I would even recommend it to managers. It will help to avoid some stupid technical decisions.
13 reviews42 followers
June 27, 2011
[рецензия на русском]

This book is a good enough introduction to modern JVM concurrency libraries. In the typical pragprogs style which mostly concentrated on hows and not so much on whys it describes basics of java.concurrent, STM of Clojure, and Akka actors library. More than half of the book devoted to teach you how to use akka actors, and STM in Java code. I don't know if it helps to Scala adoption ("Look, this Java code is soooo ugly!") or don't ("Hey, I can use those cool libraries in Java, so I don't need to learn new cooomplex languages"), but it promotes the best of JVM languages though.
Profile Image for César.
7 reviews
March 14, 2020
This book relies heavily on the Akka library and, since it was published, there was a major version update. That update removed the Software Transaction Memory (STM) part completely and changed heavily the Actor API. This took a bit of fun away from the examples since one would have to hunt down old versions of the libraries and/or update the examples until they work. Clojure’s STM it’s stable and all the Clojure examples worked out of the box. Overall this book is extremely well written, as the other books from the same author I’ve read. The code snippets are short, clear, easy to understand and type.
Profile Image for Davide Pugliese.
1 review
February 27, 2020
Theory is fine, but it lacks new concepts and ideas from Java 8.
Thus, it needs to be integrated with other textbooks or online articles.
Profile Image for Balhau.
59 reviews5 followers
November 22, 2013
Well this is a really well written book. The concurrency programming is approached with a very practical and analytical spirit. The examples are very simple but nevertheless suffice to understand some fundamental problems we must address when concurrency comes into the way. The thing that I most like on this book is the way how Venkat explain the purpose behind all the concurrency frameworks and the pros and cons of every approach. With three single concepts "shared mutability", "isolated mutability" and "pure immutability" he shows the advantages on a paradigm shift for a more functional and immutable way of design the programs when concurrency is a constraint that we must meet. He use languages like Clojure to exploit the concept of transaction and the ACI (from ACID) properties exploitable from those techniques. Akka framework is introduced as well scala as a valuable language from his functional and oop caracteristics.
7 reviews
October 26, 2014
A good start to learn modern approach to concurrency programming. STM and Actor model are no longer a mystery after this lecture. There is more emphasis on Java, but I liked equivalent examples in Scala. They opened my eyes on bolier plate code in Java and how Scala code is cleaner. Even though, this book will encourage you to start using STM and Akka actors in you Java concurrent code, and it will do this painlessly!
Profile Image for Alexandre Da silva.
1 review
March 13, 2014
Good book that explains well the challenges of concurrency programming and how to attack. Really liked the STM chapter.

I would be even happier with a a deepers dive into how to write optimal java code for better memory access/usage (mechanical sympathy stuff).

Profile Image for Hussein.
13 reviews
December 2, 2013
A must-to-read book for Java developers mainly. It was nice to see that Clojure STM can be used in Java, Scala, etc.. But I don't think there is a need to list the code in Groovy and JRuby also, wasteful effort I would say.
Anyway, all Java developers should read it.
Profile Image for Tim Dugan.
705 reviews4 followers
July 25, 2013
Ok but wished deeper analysis of solutions, more details. Should add Disruptor pattern
Displaying 1 - 11 of 11 reviews

Can't find what you're looking for?

Get help and learn more about the design.