Computer Abstractions and Techno

2022-12-17  本文已影响0人  刘东利2020

1.8 The Sea Change: The Switch from Uniprocessors to Multiprocessors

什么是Sea Change?翻译为“沧海巨变”,英文环境下也类似于范式转移(paradigm shift):

...as of 2006 all desktop and server companies are shipping microprocessors with multiple processors per chip, where the benefit is often more on throughput than on response time.

To reduce confusion between the words processor and microprocessor, companies refer to processors as “cores,” and such microprocessors are generically called multicore microprocessors.

所以,processor就是“核”(core)。针对这一个变化,作者提出了两个比喻,其中一个是来自于:

Up to now, most software has been like music written for a solo performer; with the current generation of chips we’re getting a little experience with duets and quartets and other small ensembles; but scoring a work for large orchestra and chorus is a different kind of challenge.

Brian Hayes, Computing in a Parallel Universe, 2007.

另外一个是一起写新闻稿的比喻:

As an analogy, suppose the task was to write a newspaper story. Eight reporters working on the same story could potentially write a story eight times faster. To achieve this increased speed, one would need to break up the task so that each reporter had something to do at the same time. Thus, we must schedule the sub-tasks. If anything went wrong and just one reporter took longer than the seven others did, then the benefits of having eight writers would be diminished. Thus, we must balance the load evenly to get the desired speedup.

我理解,这里整体来看还是强调“调度”(schedule)的困难 —— 中文版的翻译为“划分”,似乎不合适。

也正是因为如此,摩尔定律是变慢了的,已经无法每18个月翻一番了:

而这带来的影响,和协同写新闻的例子类似,程序员也要考虑下一代多核处理器架构的差异、甚至要重写代码:

In the past, programmers could rely on innovations in hardware, architecture, and compilers to double performance of their programs every 18 months without having to change a line of code. Today, for programmers to get significant improvement in response time, they need to rewrite their programs to take advantage of multiple processors. Moreover, to get the historic benefit of running faster on new microprocessors, programmers will have to continue to improve the performance of their code as the number of cores increases.

这一Sea Change是结构性的,所以作者强调:

To reinforce how the software and hardware systems work together, we use a special section, Hardware/Software Interface, throughout the book, with the first one appearing below. These elements summarize important insights at this critical interface.

Hardware/Software Interface的第一次出现:

Parallelism has always been crucial to performance in computing, but it was often hidden. Chapter 4 will explain pipelining, an elegant technique that runs programs faster by overlapping the execution of instructions. This optimization is one example of instruction-level parallelism, where the parallel nature of the hardware is abstracted away so the programmer and compiler can think of the hardware as executing instructions sequentially.

Forcing programmers to be aware of the parallel hardware and to rewrite their programs to be parallel had been the “third rail” of computer architecture, for companies in the past that depended on such a change in behavior failed (see Section 6.15). From this historical perspective, it’s startling that the whole IT industry has bet its future that programmers will finally successfully switch to explicitly parallel programming.

后续很多章节中,还有很多次,来反复强调这一结构性变化的影响。

上一篇下一篇

猜你喜欢

热点阅读