Forum for Science, Industry and Business

Sponsored by:     3M 
Search our Site:


Parallel programming may not be so daunting


'Lock-free' parallel algorithms may match performance of more complex 'wait-free' algorithms

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 efficiently 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 relatively easy to generate from standard sequential code. In fact, in many cases the conversion 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 fixed span of time. But if they don't exceed that standard, they squander 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 deriving them from sequential code is extremely complicated, and commercial developers have largely neglected them.

In a paper to be presented at the Association for Computing Machinery's Annual Symposium 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 analytic 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 benevolent."

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 chunks 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 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 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 randomness. 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 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.

That analysis held, no matter how the probability of thread assignment 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 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.


Additional background

Archive: "Multicore may not be so scary":

Abby Abazorius | EurekAlert!

Further reports about: Computing Engineering MIT Technion Technology decisions individual processing programming randomness technique

More articles from Information Technology:

nachricht Navigating the unknown
09.10.2015 | The Agency for Science, Technology and Research (A*STAR)

nachricht Theoretical computer science provides answers to data privacy problem
08.10.2015 | National Science Foundation

All articles from Information Technology >>>

The most recent press releases about innovation >>>

Die letzten 5 Focus-News des innovations-reports im Überblick:

Im Focus: Reliable in-line inspections of high-strength automotive body parts within seconds

Nondestructive material testing (NDT) is a fast and effective way to analyze the quality of a product during the manufacturing process. Because defective materials can lead to malfunctioning finished products, NDT is an essential quality assurance measure, especially in the manufacture of safety-critical components such as automotive B-pillars. NDT examines the quality without damaging the component or modifying the surface of the material. At this year's Blechexpo trade fair in Stuttgart, Fraunhofer IZFP will have an exhibit that demonstrates the nondestructive testing of high-strength automotive body parts using 3MA. The measurement results are available in a matter of seconds.

To minimize vehicle weight and fuel consumption while providing the highest level of crash safety, automotive bodies are reinforced with elements made from...

Im Focus: Kick-off for a new era of precision astronomy

The MICADO camera, a first light instrument for the European Extremely Large Telescope (E-ELT), has entered a new phase in the project: by agreeing to a Memorandum of Understanding, the partners in Germany, France, the Netherlands, Austria, and Italy, have all confirmed their participation. Following this milestone, the project's transition into its preliminary design phase was approved at a kick-off meeting held in Vienna. Two weeks earlier, on September 18, the consortium and the European Southern Observatory (ESO), which is building the telescope, have signed the corresponding collaboration agreement.

As the first dedicated camera for the E-ELT, MICADO will equip the giant telescope with a capability for diffraction-limited imaging at near-infrared...

Im Focus: Locusts at the wheel: University of Graz investigates collision detector inspired by insect eyes

Self-driving cars will be on our streets in the foreseeable future. In Graz, research is currently dedicated to an innovative driver assistance system that takes over control if there is a danger of collision. It was nature that inspired Dr Manfred Hartbauer from the Institute of Zoology at the University of Graz: in dangerous traffic situations, migratory locusts react around ten times faster than humans. Working together with an interdisciplinary team, Hartbauer is investigating an affordable collision detector that is equipped with artificial locust eyes and can recognise potential crashes in time, during both day and night.

Inspired by insects

Im Focus: Physicists shrink particle accelerator

Prototype demonstrates feasibility of building terahertz accelerators

An interdisciplinary team of researchers has built the first prototype of a miniature particle accelerator that uses terahertz radiation instead of radio...

Im Focus: Simple detection of magnetic skyrmions

New physical effect: researchers discover a change of electrical resistance in magnetic whirls

At present, tiny magnetic whirls – so called skyrmions – are discussed as promising candidates for bits in future robust and compact data storage devices. At...

All Focus news of the innovation-report >>>



Event News

EHFG 2015: Securing healthcare and sustainably strengthening healthcare systems

01.10.2015 | Event News

Conference in Brussels: Tracking and Tracing the Smallest Marine Life Forms

30.09.2015 | Event News

World Alzheimer`s Day – Professor Willnow: Clearer Insights into the Development of the Disease

17.09.2015 | Event News

Latest News

Unexpected information about Earth's climate history from Yellow River sediment

09.10.2015 | Earth Sciences

Single atom alloy platinum-copper catalysts cut costs, boost green technology

09.10.2015 | Life Sciences

Indefatigable Hearing

09.10.2015 | Life Sciences

More VideoLinks >>>