Is Parallel Programming Hard, And, If So, What Can You Do About It?

Paul E. McKenney

出版社

出版时间

2011-12-16

ISBN

9780954899332

评分

★★★★★

标签

编程

书籍介绍
这本书最独特的地方,在于它把并行编程从“玄学”拉回到“可讲道理”的层面。作者开篇就抛出一个近乎挑衅的判断:并行编程并没有传说中那么难,举证责任在怀疑者一方。书中反复强调三个目标——性能、生产力、通用性,并明确把自己定位给“站在技术栈最底层”的人:内核、驱动、高性能库的开发者,而非上层应用作者。读者反馈印证了这一点:它被称作“并发编程的武林秘籍”,但其价值不在速成,而在设计思路的拆解——batching、fastpath、内存屏障如何为后面的 RCU 铺路。它不适合顺序通读,也不适合前置知识不足的人硬啃;真正适合的是愿意把附录的内存屏障先啃下来、再回头理解各种同步方案为何那样设计的人。
作者简介
Paul McKenney is a Distinguished Engineer and CTO of Linux at IBM's Linux Technology Center (LTC). He is the maintainer of the Linux kernel's implementation of RCU and a contributor to the user-level implementation. He chaired the Linux Plumbers Conference Program Committee in 2009 and 2011, and served on the Linux Kernel Summit Program Committee in 2010 and 2011. He has published one netbook, one book chapter, and more than one hundred papers and presentations, and holds more than 80 patents in the USA, PRC, and elsewhere.
AI导读
核心看点
  • 本书深入剖析共享内存并行编程的核心难题,明确性能、生产力与通用性三大目标,通过历史案例警示常见陷阱,帮助开发者建立正确的并行思维框架,避免重蹈覆辙。
  • 详细讲解内存屏障、缓存一致性等底层硬件原理,从电子速度限制到乱序执行根因,彻底解构并发编程的物理基础,为理解复杂同步机制提供坚实的理论支撑。
  • 重点阐述RCU(读-拷贝-更新)等高级同步原语的设计思路与实现细节,结合Linux内核实践,深入探讨批处理、快速路径等优化策略,提供极具价值的系统设计经验。
读者共识
  • 被公认为单机多核并行编程领域的‘武林秘籍’,在共享内存并发编程方面无出其右,尽管阅读难度极大,但其在内存屏障和RCU方面的讲解深度远超普通教材,极具收藏价值。
  • 作者Paul E. McKenney学识渊博且态度谦逊,书中不仅传授技术,更传递了严谨的工程思维;读者普遍反映初读痛苦,但反复研读后对并发本质有颠覆性认知,是进阶必经之路。
  • 虽然部分章节未完成或存在翻译瑕疵,且对硬件依赖较重,但其提供的系统级并发设计视角无可替代;读者一致认为这是少数能真正讲透底层并发原理的著作,值得反复精读。
精彩摘录
  • "Therefore, if you wish to argue that parallel programming will remain as difficult as it is currently perceived by many to be, it is you who bears the burden of proof, keeping in mind the many centuries of counter-examples in a variety of fields of endeavor."
  • "the primary goals of parallel pro- gramming are performance, productivity, and gener- ality."
  • "This book is intended primarily for developers working near the bottom of the stack, where performance and generality are paramount concerns."
  • "It is important to keep in mind that parallelism is but one way to improve performance. Other well- known approaches include the following, in roughly increasing order of difficulty: 1. Run multiple instances of a sequential applica- tion. 2. Construct the application to make use of exist- ing paral"
  • "Most people have an intuitive understanding that passing messages between systems is considerably more expensive than performing simple calcula- tions within the confines of a single system. How- ever, it is not always so clear that communicat- ing among threads within the confines of a single share"
  • "shared-memory parallel programs must normally deal with no obstacle worse than a cache miss, while a distributed parallel program will typically incur the larger network communication latencies."
  • "3.3.3 Light, Not Electrons Although the speed of light would be a hard limit, the fact is that semiconductor devices are limited by the speed of electrons rather than that of light, given that electrons in semiconductor materials move at between 3% and 30% of the speed of light in a vacuum."
目录
1
Introduction
1.1 Historic Parallel Programming Difficulties . . . . . . . . . . . . . . . . .
1.2 Parallel Programming Goals . . . . . . . . . . . . . . . . . . . . . . . .
1.2.1 Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . .

显示全部
用户评论
无敌
不多见的讲解并行编程的书,应该打5星,少的一个星是因为这本书目前还没写完。。。
2019.12 最近我回顾了这本书,温故知新。本书阅读的前置条件应该是熟悉C,且对Linux内核Api有一定了解。该书不应该顺序阅读,应该把附录的内存屏障先看完,不然读示例代码会比较难受。该书前面介绍的各种同步方案,都是在给后面的rcu做铺垫,rcu是该书的核心部分。 本书聚焦的是单机多核多CPU环境下的并行编程技术,老实说这个领域没见过比这更好的书了。书中随处可见的QuickQuiz真的是精华,值得反复回味。
中文地址在这里 http://ifeve.com/perfbook/ 还需要再读几遍
讲解的方式很好,但好难
有些地方没讲清楚
Save for later. 先修知识准备不足。
非常优秀的技术书籍,书中穿插的小问题学习方法是个很好的学习方式,作者胸怀宽广,德才兼备,是一个很值得学习的人物。
下载
收藏