多处理器编程的艺术

(美)Maurice Herlihy, Nir Shavit

出版时间

2013-05-01

ISBN

9787111418580

评分

★★★★★
书籍介绍
这本书最见功力的地方,是它把「并发」从抽象的算法理论,拉回到真实的硬件地面上来。它不满足于告诉你无锁数据结构怎么实现,而是追问:为什么某些锁在多线程下会慢得离谱?缓存一致性、总线争用、缓存命中与未命中,这些看似与编程无关的硬件细节,恰恰决定了一个并发设计的生死。读者反复提到的「硬件是软件运行的容器」,正是全书的核心洞见——理解多处理器,必须先理解它赖以运行的机器。然而也正因如此,它对数学与算法推导的要求偏高,部分无锁算法讲得浅尝辄止,Java 实现又回避了内存序等底层陷阱,被不少读者认为「偷懒」。它适合愿意啃原理、追求「知其所以然」的人,而非只想照抄代码的工程师。
作者简介
Maurice Herlihy 哈佛大学的数学学士和麻省理工学院的计算机科学博士,目前为美国布朗大学计算机科学系教授,曾工作于卡内基-梅隆大学和DEC剑桥实验室。他是美国ACM会士,2003年分布式计算领域Dijkstra奖获得者。 Nir Shavit 以色列希伯来大学的计算机科学博士,目前为麻省理工学院电子工程和计算机科学系教授、以色列特拉维夫大学计算机科学系教授。1999~2011年期间,他担任Sun实验室的技术人员。 两位作者在2004年获得了理论计算机领域最高奖——哥德尔奖(G?del Prize),2012年他们共享了分布式计算领域的Edsger W. Dijkstra奖,40多年来他们一起合作,从事并行和分布式计算教学和研发工作。
AI导读
核心看点
  • 详解共享内存多线程编程基础与同步技术
  • 剖析无锁数据结构设计与高效并发算法
  • 提供Java并发工具包可执行实例与硬件背景
读者共识
  • 理论深度极高,阅读门槛较高且较为吃力
  • 内容权威实用,是并发领域的经典权威著作
  • 翻译质量参差不齐,建议配合原文或笔记阅读
精彩摘录
  • "举个例子,如果你在星期一存入工资,但是由于银行在提款后重排了存款的顺序,导致到下一个星期五才退出资金收据,这将使你感到非常恼火。"
  • "For example, we might be unhappy if we deposit our paycheck on Monday, but the bank bounces our rent check the following Friday because it reordered our deposit after your withdrawal."
  • "the TASLock performs very poorly, and the TTASLock performance, while substantially better, still falls far short of the ideal."
  • "Now consider the behavior of the TTASLock algorithm while the lock is held by a thread A. The first time thread B reads the lock it takes a cache miss, forcing B to block while the value is loaded into B's cache. As long as A holds the lock, B repeatly reread the value, but hits in the cache every t"
  • "This notion of local spinning, where threads repeatly reread cached values instead of repeatedly using the bus, is an important principle critical to the design of efficeient spin locks. Here is a key observation: if some other thread aquires the lock between hte first and second step, then, most li"
下载
收藏