计算机并行编程可能不会让人望而生畏
文章来源:未知 文章作者:enread 发布时间:2014-03-26 07:16 字体: [ ]  进入论坛
(单词翻译:双击或拖选)
Computer chips have stopped getting faster: The regular performance improvements we've come to expect are now the result of chipmakers' adding more cores, or processing units, to their chips, rather than increasing their clock speed. In theory, doubling the number of cores doubles the chip's efficiency, but splitting up computations so that they run efficiently1 in parallel isn't easy. On the other hand, say a trio of computer scientists from MIT, Israel's Technion, and Microsoft Research, neither is it as hard as had been feared.
 
Commercial software developers writing programs for multicore chips frequently use so-called "lock-free" parallel algorithms, which are relatively2 easy to generate from standard sequential code. In fact, in many cases the conversion3 can be done automatically.
 
Yet lock-free algorithms don't come with very satisfying theoretical guarantees: All they promise is that at least one core will make progress on its computational task in a fixed4 span of time. But if they don't exceed that standard, they squander5(浪费) all the additional computational power that multiple cores provide.
 
In recent years, theoretical computer scientists have demonstrated ingenious alternatives called "wait-free" algorithms, which guarantee that all cores will make progress in a fixed span of time. But deriving6 them from sequential code is extremely complicated, and commercial developers have largely neglected them.
 
In a paper to be presented at the Association for Computing7 Machinery's Annual Symposium8 on the Theory of Computing in May, Nir Shavit, a professor in MIT's Department of Electrical Engineering and Computer Science; his former student Dan Alistarh, who's now at Microsoft Research; and Keren Censor-Hillel of the Technion demonstrate a new analytic9 technique suggesting that, 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 how [chip] schedulers work, that they are actually benevolent10(仁慈的)."
 
The researchers' key insight was that the chip's performance as a whole could be characterized more simply than the performance of the individual cores. That's because the allocation of different "threads," or chunks11 of code executed in parallel, is symmetric. "It doesn't matter whether thread 1 is in state A and thread 2 is in state B or if you just swap12 the states around," says Alistarh, who contributed to the work while at MIT. "What we noticed is that by coalescing13 symmetric states, you can simplify this a lot."
 
In a real chip, the allocation 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 randomness15. So the researchers modeled the scheduling of threads as a process that has at least a little randomness in it: At any time, there's some probability that a new thread will be initiated16 on any given core.
 
The researchers found that even with a random14 scheduler, a wide range of lock-free algorithms offered performance guarantees that were as good as those offered by wait-free algorithms.
 
That analysis held, no matter how the probability of thread assignment varied17 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 the others. That's the situation that results in a lock-free algorithm's worst performance, when only one core is making progress.
 
For that case, they considered a particular set of probabilities, in which every core had the same chance of being assigned a thread at any given time. "This is kind of a worst-case random scheduler," Alistarh says. Even then, however, the number of cores that made progress never dipped below the square root of the number of cores assigned threads, which is still better than the minimum performance guarantee of lock-free algorithms.


点击收听单词发音收听单词发音  

1 efficiently ZuTzXQ     
adv.高效率地,有能力地
参考例句:
  • The worker oils the machine to operate it more efficiently.工人给机器上油以使机器运转更有效。
  • Local authorities have to learn to allocate resources efficiently.地方政府必须学会有效地分配资源。
2 relatively bkqzS3     
adv.比较...地,相对地
参考例句:
  • The rabbit is a relatively recent introduction in Australia.兔子是相对较新引入澳大利亚的物种。
  • The operation was relatively painless.手术相对来说不痛。
3 conversion UZPyI     
n.转化,转换,转变
参考例句:
  • He underwent quite a conversion.他彻底变了。
  • Waste conversion is a part of the production process.废物处理是生产过程的一个组成部分。
4 fixed JsKzzj     
adj.固定的,不变的,准备好的;(计算机)固定的
参考例句:
  • Have you two fixed on a date for the wedding yet?你们俩选定婚期了吗?
  • Once the aim is fixed,we should not change it arbitrarily.目标一旦确定,我们就不应该随意改变。
5 squander XrnyF     
v.浪费,挥霍
参考例句:
  • Don't squander your time in reading those dime novels.不要把你的时间浪费在读那些胡编乱造的廉价小说上。
  • Every chance is precious,so don't squander any chance away!每次机会都很宝贵,所以不要将任何一个白白放走。
6 deriving 31b45332de157b636df67107c9710247     
v.得到( derive的现在分词 );(从…中)得到获得;源于;(从…中)提取
参考例句:
  • I anticipate deriving much instruction from the lecture. 我期望从这演讲中获得很多教益。 来自《简明英汉词典》
  • He anticipated his deriving much instruction from the lecture. 他期望从这次演讲中得到很多教益。 来自辞典例句
7 computing tvBzxs     
n.计算
参考例句:
  • to work in computing 从事信息处理
  • Back in the dark ages of computing, in about 1980, they started a software company. 早在计算机尚未普及的时代(约1980年),他们就创办了软件公司。
8 symposium 8r6wZ     
n.讨论会,专题报告会;专题论文集
参考例句:
  • What have you learned from the symposium?你参加了这次科学讨论会有什么体会?
  • The specialists and scholars present at the symposium come from all corners of the country.出席研讨会的专家学者们来自全国各地。
9 analytic NwVzn     
adj.分析的,用分析方法的
参考例句:
  • The boy has an analytic mind. 这男孩有分析的头脑。
  • Latin is a synthetic language,while English is analytic.拉丁文是一种综合性语言,而英语是一种分析性语言。
10 benevolent Wtfzx     
adj.仁慈的,乐善好施的
参考例句:
  • His benevolent nature prevented him from refusing any beggar who accosted him.他乐善好施的本性使他不会拒绝走上前向他行乞的任何一个乞丐。
  • He was a benevolent old man and he wouldn't hurt a fly.他是一个仁慈的老人,连只苍蝇都不愿伤害。
11 chunks a0e6aa3f5109dc15b489f628b2f01028     
厚厚的一块( chunk的名词复数 ); (某物)相当大的数量或部分
参考例句:
  • a tin of pineapple chunks 一罐菠萝块
  • Those chunks of meat are rather large—could you chop them up a bIt'smaller? 这些肉块相当大,还能再切小一点吗?
12 swap crnwE     
n.交换;vt.交换,用...作交易
参考例句:
  • I will swap you my bicycle for your radio.我想拿我的自行车换你的收音机。
  • This comic was a swap that I got from Nick.这本漫画书是我从尼克那里换来的。
13 coalescing b795440b9ade4378fef3486b241378bc     
v.联合,合并( coalesce的现在分词 )
参考例句:
  • A mental model begins coalescing in their minds. 一个意识模型开始结合到他们的脑子里。 来自互联网
  • On the basis of coalescing this kind of element can separate oil from compressed air. 采用凝聚原理,分离压缩空气中的油份。 来自互联网
14 random HT9xd     
adj.随机的;任意的;n.偶然的(或随便的)行动
参考例句:
  • The list is arranged in a random order.名单排列不分先后。
  • On random inspection the meat was found to be bad.经抽查,发现肉变质了。
15 randomness af1c2e393e31ba3c5a65a5ccc64d0789     
n.随意,无安排;随机性
参考例句:
  • The randomness is attributed to the porous medium. 随机性起因于多孔介质。 来自辞典例句
  • Einstein declared that randomness rather than lawfulness is the characteristic of natural events. 爱因斯坦宣称自然现象的特征为不可测性而不是规律化。 来自辞典例句
16 initiated 9cd5622f36ab9090359c3cf3ca4ddda3     
n. 创始人 adj. 新加入的 vt. 开始,创始,启蒙,介绍加入
参考例句:
  • He has not yet been thoroughly initiated into the mysteries of computers. 他对计算机的奥秘尚未入门。
  • The artist initiated the girl into the art world in France. 这个艺术家介绍这个女孩加入巴黎艺术界。
17 varied giIw9     
adj.多样的,多变化的
参考例句:
  • The forms of art are many and varied.艺术的形式是多种多样的。
  • The hotel has a varied programme of nightly entertainment.宾馆有各种晚间娱乐活动。
TAG标签: computer chips cores
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
验证码:点击我更换图片