Seven Concurrency Models in Seven Weeks

Author:  Paul Butcher 
Publisher: Pragmatic Programmers
Pages: 300
ISBN: 978-1937785659
Audience: Experienced programmers
Rating: 4.5
Reviewer: Mike James

The subtitle tells it all "When Threads Unravel".

Concurrency is not an easy topic. Just when you think you understand it there seems to be another way to make a mess of it just waiting to be discovered.

This isn't a traditional academic book on the subject. It is an attempt to explain concurrency in a reasonably practical way. Don't expect the book to give you definitive answers it is more about making you aware of the problems and how to avoid them. 

The introduction explains what concurrency is and contrasts the idea os asynchronous and parallel execution. It also introduces the seven models to be examined in the the book: 

  • Thread and locks
  • Functional programming
  • The Clojure Way - separating identity and state
  • Actors
  • Communicating Sequential Processes (CSP)
  • Data parallelism
  • Lambda Architecture

Chapter 2 starts with on this list with threads and locks and it is a potted introduction to the basic approach to concurrency. It is some of what you would learn in a computer science course on the topic including the well known dining philosopher's problem, deadlock and all manner of locking schemes. The discussion is good and so are the examples. Occasionally the explanations miss some of the questions that every beginner has such as why do we lock on this so often and how do you organize which objects to use as locks. 

Chapter 3 is a look at functional programming and it is the first of a number of chapters on Clojure, a Lisp-like language that runs on the JVM. This is by no means a Clojure book, but you do have to read and follow the examples given in the language. It is used to make a point. After a good explanation of why functional programming is a good idea and how it makes concurrency easy because of immutable data structures and pure functions we don't really get to grips with why this is. Instead we learn about how to implement functional parallelism with a map reduce type approach. The next chapter follows on with a deeper look at Clojure and the Agents/Transactional memory approach.   

Chapter 5 looks at another approach to concurrency this time Actors in Elixir, which isn't the most commonly used language in the world but is difficult to beat when it comes to this job.

Chapter 6 uses Go as an example of communicating sequential processes, i.e. Go channels.

Chapter 7 introduces the use of the GPU as a general purpose parallel computer. This is just deep enough for you to start to understand. If you want to know more you will need another book on OpenCL.

The final chapter is about the Lambda architecture which is essentially Hadoop and map reduce.  


This is an easy to read book on a difficult topic and for this it is welcome. It is a good introduction to seven approaches to the problem, or rather seven aspects of the problem. It isn't a book about Clojure, which you might conclude from looking at the chapter headings, but it isn't a book about pure concurrency either  - different languages are used to illustrate the approaches.

Personally I would have liked more on the basic approach using locks and something on lock free algorithms. It also doesn't cover the problem of asynchronous programming and there is no mention or promises or async and await. Don't expect it to teach you all of the techniques in, say  Java concurrency or how to best use locks, but it will give you a reasonable overview of the topic. 

This is a good book if you want to read around the topic rather than solve a specific problem. For this it is highly recommended. 


To keep up with our coverage of books for programmers, follow @bookwatchiprog on Twitter or subscribe to I Programmer's Books RSS feed for each day's new addition to Book Watch and for new reviews.


Sams Teach Yourself JavaScript in 24 Hours (7e)

Author: Phil Ballard
Publisher: Sams Teach Yourself
Date: November 2018
Pages: 432
ISBN: 978-0672338090
Print: 0672338092
Kindle: B07H2KXFWP
Audience: Would-be JavaScript web devs
Rating: 4
Reviewer: Ian Elliot
JavaScript is an easy to learn language so can 24 hours turn you from a beginner to an exper [ ... ]

Python Machine Learning, 3rd Ed

Authors: Sebastian Raschka and Vahid Mirjalili
Publisher: Packt
Date: December 2019
Pages: 770
ISBN: 978-1789955750
Print: 1789955750
Kindle: B07VBLX2W7
Audience: Python devs interested in ML
Rating: 5
Reviewer: Mike James
A new edition of a good book on ML is worth a close look.

More Reviews

Last Updated ( Friday, 04 November 2016 )