Only for 'Thread Monkeys'
November 15, 2011
With the title “The Art of Concurrency”, high expectations are set that are not met. The subtitle “A Thread Monkey’s Guide to Writing Parallel Applications” is more fitting for the content, but even here, there are several points of criticism.
In this book, thread-based programming for shared-memory computers is explained using POSIX Threads (pthreads), Windows Threads, OpenMP, and Intel Threading Building Blocks in a C-like language. It is therefore only of limited suitability for Java programmers.
The theoretical foundations of parallelism and concurrency are only briefly explained using PRAM. Other models, e.g., the Actor model, Petri nets, or process calculi, are completely missing. There is also nothing about “futures” and “promises”.
What the author does well, on the other hand, is explaining how to derive thread-based code for shared-memory architectures from an algorithm designed for PRAM—how best to parallelize something, drawing from his rich experience.
Readers with enough interest in this type of programming will find many examples here. However, opponents who argue that code with threads and shared memory easily becomes complicated and leads to unmaintainable code chaos will also find supporting evidence.
A total of 13 algorithms (6 of which are sorting methods) are parallelized. Personally, it is not clear to me why the possibilities of parallelization aren’t shown using 2-3 example algorithms. What is this book trying to teach me? Basic algorithms? These are explained better and more thoroughly in other books (Cormen, Leiserson, Rivest, etc.). Furthermore, the C-like programming language used is didactically unsuitable.
Unfortunately, there are no exercises in the book, so the reader cannot become active themselves and test what they have learned.
When I read the following on Wikipedia under “Minimal Spanning Tree”—”Typically, parallel algorithms are based on Bor’vka algorithm’Prim’s and especially Kruskal’s algorithm do not scale as well to additional processors.”—I wondered why exactly those last two were implemented in the book.
Conclusion: The subtitle describes the book quite well; however, it is far from being a book about the art of programming, such as Donald Knuth’s “The Art of Computer Programming”.
- Clay Breshears
- The Art of Concurrency: A Thread Monkey’s Guide to Writing Parallel Applications
- O’Reilly
- 2009
See also the review on Amazon