Textbook review: Is Parallel Programming Hard, And, If So, What Can You Do About It?
During my recent vacation to Canada, I had the opportunity to delve into the free online textbook "Is Parallel Programming Hard, And, If So, What Can You Do About It?" by Paul E. McKenney. Having spent a considerable amount of time working with TLA+ and distributed systems, I was seeking a change in focus and believed that this textbook would provide valuable insights into the realm of concurrent programming.
The book is available in three separate formats, all in PDF, which made it convenient for me to read on my Pine64 PineNote. However, the inclusion of numerous internal links presented some challenges. While these links served various purposes such as quick knowledge-check questions and navigation aids, they often proved disruptive.
Accidentally activating a link could redirect me to unrelated content, making it difficult to navigate the text efficiently. The e-book version of the textbook exacerbated this issue, as the lack of physical page-turn buttons further hindered smooth navigation.
Despite these drawbacks, the textbook proved to be an excellent resource for my level of understanding. It began with engaging introductory chapters that provided motivation for the subject matter, before progressing to more advanced topics in Chapter 3, "Hardware and its Habits." This chapter delved into the inner workings of modern CPUs, explaining their speed and performance limitations. The author employed humorous illustrations to make the complex concepts more accessible.
One particularly interesting section that caught my attention was Section 3.2.1, "Hardware System Architecture." Here, the author walked through a simplified explanation of how a CPU core interacts with memory, even when accessing an address that doesn't exist in its cache. This particular section stood out to me as it provided a clear and concise overview of cache memory behavior, a topic that I had struggled to grasp previously.
However, there were a few areas where the textbook could have benefited from additional explanation. Specifically, I found myself lacking a basic understanding of the MESI protocol, which governs how CPU caches handle concurrent reads and writes. The MESI protocol was only briefly mentioned in the appendix of the book, leaving me with insufficient knowledge to fully appreciate the concepts discussed in the section.
To overcome this gap in my understanding, I had to resort to external research, specifically searching online for information on MESI.
Despite these minor shortcomings, the overall structure and content of the textbook proved to be an ideal match for my current knowledge level. It started with accessible introductory chapters and gradually progressed to more advanced topics, including cache memory behavior and concurrent programming. The author's use of humorous illustrations and engaging explanations made the subject matter more approachable and enjoyable to read.
In conclusion, "Is Parallel Programming Hard, And, If So, What Can You Do About It?" is a valuable resource for those looking to expand their knowledge of concurrent programming and the intricacies of CPU caches. While the inclusion of numerous links and the lack of a thorough explanation of the MESI protocol were minor drawbacks, the overall structure and content of the book catered well to my level of understanding.
I found it to be an informative and enjoyable read, and I would recommend it to anyone seeking to deepen their understanding of parallel programming.
Written by urgent.news from Lobsters's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.