《2023年计算机并行编程可能不会让人望而生畏.docx》由会员分享,可在线阅读,更多相关《2023年计算机并行编程可能不会让人望而生畏.docx(5页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、2023年计算机并行编程可能不会让人望而生畏 Computer chips have stopped getting faster: The regular performance improvements weve come to expect are now the result of chipmakers adding more cores, or proceing units, to their chips, rather than increasing their clock speed.In theory, doubling the number of cores doubles
2、the chips efficiency, but splitting up computations so that they run efficiently in parallel isnt easy.On the other hand, say a trio of computer scientists from MIT, Israels Technion, and Microsoft Research, neither is it as hard as had been feared. Commercial software developers writing programs fo
3、r multicore chips frequently use so-called lock-free parallel algorithms, which are relatively easy to generate from standard sequential code.In fact, in many cases the conversion can be done automatically. Yet lock-free algorithms dont come with very satisfying theoretical guarantees: All they prom
4、ise is that at least one core will make progre on its computational task in a fixed span of time.But if they dont exceed that standard, they squander(浪费) all the additional computational power that multiple cores provide. In recent years, theoretical computer scientists have demonstrated ingenious a
5、lternatives called wait-free algorithms, which guarantee that all cores will make progre in a fixed span of time.But deriving them from sequential code is extremely complicated, and commercial developers have largely neglected them. In a paper to be presented at the Aociation for Computing Machinery
6、s Annual Symposium on the Theory of Computing in May, Nir Shavit, a profeor in MITs Department of Electrical Engineering and Computer Science; his former student Dan Alistarh, whos now at Microsoft Research; and Keren Censor-Hillel of the Technion demonstrate a new analytic technique suggesting that
7、, in a wide range of real-world cases, lock-free algorithms actually give wait-free performance. In practice, programmers program as if everything is wait-free, Shavit says.This is a kind of mystery.What we are exposing in the paper is this little-talked-about intuition that programmers have about h
8、ow chip schedulers work, that they are actually benevolent(仁慈的). The researchers key insight was that the chips performance as a whole could be characterized more simply than the performance of the individual cores.Thats because the allocation of different threads, or chunks of code executed in para
9、llel, is symmetric.It doesnt matter whether thread 1 is in state A and thread 2 is in state B or if you just swap the states around, says Alistarh, who contributed to the work while at MIT.What we noticed is that by coalescing symmetric states, you can simplify this a lot. In a real chip, the alloca
10、tion of threads to cores is a complex interplay of latencies and scheduling policies, Alistarh says.In practice, however, the decisions arrived at through that complex interplay end up looking a lot like randomne.So the researchers modeled the scheduling of threads as a proce that has at least a lit
11、tle randomne in it: At any time, theres some probability that a new thread will be initiated on any given core. The researchers found that even with a random scheduler, a wide range of lock-free algorithms offered performance guarantees that were as good as those offered by wait-free algorithms. Tha
12、t analysis held, no matter how the probability of thread aignment varied from core to core.But the researchers also performed a more specific analysis, asking what would happen when multiple cores were trying to write data to the same location in memory and one of them kept getting there ahead of th
13、e others.Thats the situation that results in a lock-free algorithms worst performance, when only one core is making progre. For that case, they considered a particular set of probabilities, in which every core had the same chance of being aigned a thread at any given time.This is kind of a worst-cas
14、e random scheduler, Alistarh says.Even then, however, the number of cores that made progre never dipped below the square root of the number of cores aigned threads, which is still better than the minimum performance guarantee of lock-free algorithms. More:商务英语学习资料 计算机并行编程可能不会让人望而生畏 计算机软件编程常用英语词汇表面试的时候可能用得到