Menu

Very good in places, unpolished and too brief in others

December 01, 2011

Programming parallel and concurrent programs with shared memory and threads is complicated and very error-prone. Approaches such as Software Transactional Memory (STM), message-passing architectures, and actor models have been developed as solutions. In “Programming Concurrency on the JVM”, these are presented for the Java platform.

In the Java world, the java.util.concurrent package has existed for thread-based shared-memory development since Java 5. After an introduction to concurrent programming, the author presents excerpts of this over approximately 40 pages. In doing so, the author does a good job of illustrating the problems that arise from shared memory. However, anyone looking for more detailed information should read “Java Concurrency in Practice” by Goetz (this is also mentioned in the book).

In Chapter 6, when introducing STM, the author gives the impression that it was invented by the developer of the Clojure language. This is not the case, and in a scholarly book, the development of STMs should be briefly addressed.

However, this is not the only place where the author is quite brief. In many other places, one sees notes like “If you want to know more, it’s better to check the documentation.”

On the other hand, Chapter 7 is nice, where examples of STM in Clojure, Groovy, Java, JRuby, and Scala are discussed.

Actors are explained in Chapter 8 using the Akka library. Java and Scala are used here, and I wondered the whole time why the author also uses Akka in Scala instead of the actors provided by Scala itself. But at the end of Chapter 9, which contains further examples of actors in Groovy, Java, and JRuby, I was enlightened: Akka is significantly more performant.

Here too, a weakness of the book becomes apparent: in many places, it looks as if the book was finished in a hurry. In particular, the sections on using Multiverse with Java were not clear to me. This is probably because there is no separate chapter with examples for Multiverse. Thus, the sentence “Akka uses Multiverse’s Clojure-style STM for Java code” on page 103 remained incomprehensible to me without reading the Multiverse documentation.

Another difficult part is the presentation of Clojure STM on page 94. Also, the author suddenly no longer seems critical, but very euphoric, and for a moment I felt that the author was not being critical enough toward the topic of STM.

Since the book is otherwise quite readable and you learn a lot about actors and STM, I give it 3 stars.

Conclusion: Very good in places, unpolished and too brief in others.

  • Venkat Subramaniam
  • Programming Concurrency on the JVM
  • Pragmatic Programmers
  • 2011

See also the review on Amazon.

categorySoftware Engineering