Getting Serious About Transactional Memory

By Michael Feldman

January 12, 2007

The parallelization of computing, via multi-threading cores, multi-core processors and multi-processor systems is encouraging ever greater levels of application concurrency to take advantage of the proliferating CPUs. Multi-core processors, in particular, are fueling this phenomenon.

Beyond the dual- or quad-core domain, manufacturers are starting to build many-core chips. Examples include the Niagara T1 UltraSPARC from Sun Microsystems, which has 8 cores and can support 32 threads (the next-generation Rock processor will double this to 16 cores and 64 threads); Cavium Networks 16-core OCTEON MIPS64 processor for embedded applications; and Intel's Polaris prototype processor, which sports 80 cores and boasts a peak teraflop.

The Polaris prototype, which is part of Intel's terascale computing initiative, is motivating researchers there to take a hard look at a relatively new technology — transactional memory or TM, for short. Within the next ten years, the prospect of multi-core teraflop processors like Polaris and new application domains to use those processors will require vastly more parallel processing than ever before. Even incorporating relatively low levels of concurrency in today's applications is already challenging some of our best developers.

One of the nastiest concurrency problems has to do with keeping data thread-safe, that is maintaining global data integrity in the presence of parallel executing threads. Failure to keep data thread-safe leads to deadlocks, race conditions (data corruption) and priority inversion. Worse, because these types of problems are time-sensitive, they are often very hard to find during normal testing and in some cases go undetected until after the application is deployed.

The typical way to keep data thread-safe is to use global locks around objects that are being accessed by more than one thread. Locks provide a synchronization mechanism that blocks concurrent access of an object, preventing the data race condition. Seems simple enough. But there are a number of problems with this approach. Sometimes locks become dependent on each other, such that each thread is holding a lock the other thread needs. Or if a thread dies holding a lock it can block other dependent threads.

Even for correctly implemented locks, there's the issue of granularity. Coarse granularity protects larger data objects and uses fewer locks. But as the number of threads scales up, performance suffers. Finer granularity allows the programmer to protect smaller data items and gives better performance as long (as lock overhead is not overwhelming). It makes it possible, for example, to lock individual record components rather than the entire record structure. But finer granularity requires more complex algorithms and more locks, so it is often much more difficult to implement correctly.

Transactional memory to the rescue

Terascale computing, which relies on many-core parallelism, will be very difficult to develop. The current languages only provide low-level concurrency features. For Intel, terascale computing has become the prime motivator to improve software concurrency technology. The company's 80-core Polaris prototype will require much greater levels of application concurrency than today. And the scaling up of multi-core processors across time and product families will necessitate a solution that doesn't require reprogramming based on core count.

“How can the programmer write parallel code more effectively, that is, write robust code that doesn't have bugs, but still scales and benefits from the additional cores that each successive generation provides,” asks Ali-Reza Adl-Tabatabai, Intel Principal Engineer? “That's the big challenge that we're going after.”

To that end, Intel researchers are looking to transactional memory as one of the key technologies that will enable developers to write the terascale killer apps of the next decade. The attraction of TM is that is appears to solve the most annoying problems of global locks: application robustness and scalability. These attributes are especially important for the type of large-scale concurrency required by terascale applications.

Like locks, transactional memory is a construct for concurrency control that enables access to data shared by multiple threads. But unlike locks it is an optimistic model. It assumes that in most cases only a single thread will be contending for a given data item. A transaction is a high-level construct that executes reads and writes to data as an indivisible operation. From the application's point of view intermediate states are not visible to other successful transactions. So when a logical transaction is complete, the system verifies that other logical transactions haven't made changes to the same memory that would conflict with the first transaction. If they have, then the transaction is re-executed until it succeeds.

Intel's view is that TM should be encapsulated in language construct, and initially implemented in software. At some point, it may be useful to provide a hardware assist to provide better performance or functionality. But this is not necessarily the case.

Adl-Tabatabai says that dynamic memory garbage collection, a technology introduced about 50 years ago, may be a good analogy of how transactional memory will evolve. Initially, there were a number of techniques for implementing garbage collection in software. People thought that they really would like hardware support for this. But the software algorithms evolved and eventually made it into mainstream languages like Java. It turned out that hardware assistance wasn't really needed. In any case, once the language semantics of TM are defined, the software/hardware implementation should be transparent to the application developer.

Intel researchers have prototyped extensions to Java and C that incorporate transactional memory constructs. They've also investigated using various compiler optimizations for transactional memory implementations. Below are two trivial code examples that make data object 'x' thread-safe. The first uses explicit locking, the second uses the atomic block construct for transactional memory.

   lock(L); x++; unlock(L);

   atomic {x++;}

The atomic construct guarantees the enclosed operations will be safe from thread concurrency. The data transactions within the construct will either execute completely or have no effect until it is safe to do so. When the atomic block executes this happens as if in a single step in relation to the other threads. In other words, from the programmer's point of view, the transactions run in isolation.

The DARPA HPCS research languages (Fortress, X10, Chapel) for high productivity computing all provide atomic block construct in lieu of explicit lock synchronization. A few other investigators have incorporated TM into other research languages, but the final language to emerge from the DARPA HPCS program may be the first one to formally introduce it as a standard feature.

“The fact that the HPCS languages decided to provide atomic constructs rather than locking constructs shows that there's general consensus in the language design community that this is the way to go for concurrency control in future languages,” notes Adl-Tabatabai.

According to Adl-Tabatabai, The HPCS language effort represents a real step forward, since it will incorporate TM from the beginning. Retrofitting transactions into older languages that previously used locks can be problematic, since mixing explicit locking and implicit locking via a low-level implementation of TM may introduce conflicts when dealing with legacy code.

Scaling to advantage

On many applications, coarse-grained locking — putting locks around whole data structures — doesn't scale well. Threads that are concurrently accessing the same data structure must wait unnecessarily when they are reading or writing disjoint data within the structure. To increase performance, the developer must re-program the algorithm using fine-grained locking — putting global locks around individual data items in the data structures. Fine-grained locking allows different threads to concurrently access disjoint data in the same data structures. Transactional memory implicitly provides fine-grained locking, automatically providing the associated performance benefits.

Adl-Tabatabai describes an example using traditional fine-grained locking for a hash table. Using the Java 5 class libraries, a professor of computer science (who wrote a book on Java concurrency) was able to make the appropriate modifications to the hash table algorithms to incorporate fine-grained locking. The changes were subtle, yet quite complex. After two years of reviews by the Java standards committees, it was approved for inclusion into the Java class libraries.

“In general, doing this kind of coding is very difficult,” says Adl-Tabatabai. “You're not going to be able to get your average Joe Programmer to write code like this, and write it in a way that's error-free and doesn't introduce data races or deadlocks.”

Besides fine-grained locking, TM has the additional advantage of allowing for concurrent reads of the same data, which traditional locks cannot do. A special type of lock, called a reader-writer lock can be used to overcome this deficiency but this requires application code modifications. Transactional memory, on the other hand provides a systematic way for programmers to take advantage of these features.

With no existing base of software, how will TM get mainstreamed into applications? Jerry Bautista, Director, Microprocessor Technology Management at Intel says the evolution to multi-core architectures will create a need in the marketplace for technologies like transactional memory as the complexity of programming creates a new set of challenges.

“As we introduce more high performance hardware, there will be a demand generated in the programming community for ways to get around these common problems,” says Bautista. “People are already noting these challenges today. We're just trying to run ahead here.”

Subscribe to HPCwire's Weekly Update!

Be the most informed person in the room! Stay ahead of the tech trends with industy updates delivered to you every week!

HPC Career Notes: July 2020 Edition

July 1, 2020

In this monthly feature, we'll keep you up-to-date on the latest career developments for individuals in the high-performance computing community. Whether it's a promotion, new company hire, or even an accolade, we've got Read more…

By Mariana Iriarte

Supercomputers Enable Radical, Promising New COVID-19 Drug Development Approach

July 1, 2020

Around the world, innumerable supercomputers are sifting through billions of molecules in a desperate search for a viable therapeutic to treat COVID-19. Those molecules are pulled from enormous databases of known compoun Read more…

By Oliver Peckham

HPC-Powered Simulations Reveal a Looming Climatic Threat to Vital Monsoon Seasons

June 30, 2020

As June draws to a close, eyes are turning to the latter half of the year – and with it, the monsoon and hurricane seasons that can prove vital or devastating for many of the world’s coastal communities. Now, climate Read more…

By Oliver Peckham

Hyperion Forecast – Headwinds in 2020 Won’t Stifle Cloud HPC Adoption or Arm’s Rise

June 30, 2020

The semiannual taking of HPC’s pulse by Hyperion Research – late fall at SC and early summer at ISC – is a much-watched indicator of things come. This year is no different though the conversion of ISC to a digital Read more…

By John Russell

What’s New in HPC Research: Mosquitoes, [email protected], the Last Journey & More

June 29, 2020

In this bimonthly feature, HPCwire highlights newly published research in the high-performance computing community and related domains. From parallel programming to exascale to quantum computing, the details are here. Read more…

By Oliver Peckham

AWS Solution Channel

Maxar Builds HPC on AWS to Deliver Forecasts 58% Faster Than Weather Supercomputer

When weather threatens drilling rigs, refineries, and other energy facilities, oil and gas companies want to move fast to protect personnel and equipment. And for firms that trade commodity shares in oil, precious metals, crops, and livestock, the weather can significantly impact their buy-sell decisions. Read more…

Intel® HPC + AI Pavilion

Supercomputing the Pandemic: Scientific Community Tackles COVID-19 from Multiple Perspectives

Since their inception, supercomputers have taken on the biggest, most complex, and most data-intensive computing challenges—from confirming Einstein’s theories about gravitational waves to predicting the impacts of climate change. Read more…

Racism and HPC: a Special Podcast

June 29, 2020

Promoting greater diversity in HPC is a much-discussed goal and ostensibly a long-sought goal in HPC. Yet it seems clear HPC is far from achieving this goal. Recent U.S. events, most poignantly the killing of George Floy Read more…

Hyperion Forecast – Headwinds in 2020 Won’t Stifle Cloud HPC Adoption or Arm’s Rise

June 30, 2020

The semiannual taking of HPC’s pulse by Hyperion Research – late fall at SC and early summer at ISC – is a much-watched indicator of things come. This yea Read more…

By John Russell

Racism and HPC: a Special Podcast

June 29, 2020

Promoting greater diversity in HPC is a much-discussed goal and ostensibly a long-sought goal in HPC. Yet it seems clear HPC is far from achieving this goal. Re Read more…

Top500 Trends: Movement on Top, but Record Low Turnover

June 25, 2020

The 55th installment of the Top500 list saw strong activity in the leadership segment with four new systems in the top ten and a crowning achievement from the f Read more…

By Tiffany Trader

ISC 2020 Keynote: Hope for the Future, Praise for Fugaku and HPC’s Pandemic Response

June 24, 2020

In stark contrast to past years Thomas Sterling’s ISC20 keynote today struck a more somber note with the COVID-19 pandemic as the central character in Sterling’s annual review of worldwide trends in HPC. Better known for his engaging manner and occasional willingness to poke prickly egos, Sterling instead strode through the numbing statistics associated... Read more…

By John Russell

ISC 2020’s Student Cluster Competition Winners Announced

June 24, 2020

Normally, the Student Cluster Competition involves teams of students building real computing clusters on the show floors of major supercomputer conferences and Read more…

By Oliver Peckham

Hoefler’s Whirlwind ISC20 Virtual Tour of ML Trends in 9 Slides

June 23, 2020

The ISC20 experience this year via livestreaming and pre-recordings is interesting and perhaps a bit odd. That said presenters’ efforts to condense their comments makes for economic use of your time. Torsten Hoefler’s whirlwind 12-minute tour of ML is a great example. Hoefler, leader of the planned ISC20 Machine Learning... Read more…

By John Russell

At ISC, the Fight Against COVID-19 Took the Stage – and Yes, Fugaku Was There

June 23, 2020

With over nine million infected and nearly half a million dead, the COVID-19 pandemic has seized the world’s attention for several months. It has also dominat Read more…

By Oliver Peckham

Japan’s Fugaku Tops Global Supercomputing Rankings

June 22, 2020

A new Top500 champ was unveiled today. Supercomputer Fugaku, the pride of Japan and the namesake of Mount Fuji, vaulted to the top of the 55th edition of the To Read more…

By Tiffany Trader

Supercomputer Modeling Tests How COVID-19 Spreads in Grocery Stores

April 8, 2020

In the COVID-19 era, many people are treating simple activities like getting gas or groceries with caution as they try to heed social distancing mandates and protect their own health. Still, significant uncertainty surrounds the relative risk of different activities, and conflicting information is prevalent. A team of Finnish researchers set out to address some of these uncertainties by... Read more…

By Oliver Peckham

[email protected] Turns Its Massive Crowdsourced Computer Network Against COVID-19

March 16, 2020

For gamers, fighting against a global crisis is usually pure fantasy – but now, it’s looking more like a reality. As supercomputers around the world spin up Read more…

By Oliver Peckham

[email protected] Rallies a Legion of Computers Against the Coronavirus

March 24, 2020

Last week, we highlighted [email protected], a massive, crowdsourced computer network that has turned its resources against the coronavirus pandemic sweeping the globe – but [email protected] isn’t the only game in town. The internet is buzzing with crowdsourced computing... Read more…

By Oliver Peckham

Global Supercomputing Is Mobilizing Against COVID-19

March 12, 2020

Tech has been taking some heavy losses from the coronavirus pandemic. Global supply chains have been disrupted, virtually every major tech conference taking place over the next few months has been canceled... Read more…

By Oliver Peckham

Supercomputer Simulations Reveal the Fate of the Neanderthals

May 25, 2020

For hundreds of thousands of years, neanderthals roamed the planet, eventually (almost 50,000 years ago) giving way to homo sapiens, which quickly became the do Read more…

By Oliver Peckham

DoE Expands on Role of COVID-19 Supercomputing Consortium

March 25, 2020

After announcing the launch of the COVID-19 High Performance Computing Consortium on Sunday, the Department of Energy yesterday provided more details on its sco Read more…

By John Russell

Steve Scott Lays Out HPE-Cray Blended Product Roadmap

March 11, 2020

Last week, the day before the El Capitan processor disclosures were made at HPE's new headquarters in San Jose, Steve Scott (CTO for HPC & AI at HPE, and former Cray CTO) was on-hand at the Rice Oil & Gas HPC conference in Houston. He was there to discuss the HPE-Cray transition and blended roadmap, as well as his favorite topic, Cray's eighth-gen networking technology, Slingshot. Read more…

By Tiffany Trader

Honeywell’s Big Bet on Trapped Ion Quantum Computing

April 7, 2020

Honeywell doesn’t spring to mind when thinking of quantum computing pioneers, but a decade ago the high-tech conglomerate better known for its control systems waded deliberately into the then calmer quantum computing (QC) waters. Fast forward to March when Honeywell announced plans to introduce an ion trap-based quantum computer whose ‘performance’ would... Read more…

By John Russell

Leading Solution Providers


Neocortex Will Be First-of-Its-Kind 800,000-Core AI Supercomputer

June 9, 2020

Pittsburgh Supercomputing Center (PSC - a joint research organization of Carnegie Mellon University and the University of Pittsburgh) has won a $5 million award Read more…

By Tiffany Trader

‘Billion Molecules Against COVID-19’ Challenge to Launch with Massive Supercomputing Support

April 22, 2020

Around the world, supercomputing centers have spun up and opened their doors for COVID-19 research in what may be the most unified supercomputing effort in hist Read more…

By Oliver Peckham

Australian Researchers Break All-Time Internet Speed Record

May 26, 2020

If you’ve been stuck at home for the last few months, you’ve probably become more attuned to the quality (or lack thereof) of your internet connection. Even Read more…

By Oliver Peckham

15 Slides on Programming Aurora and Exascale Systems

May 7, 2020

Sometime in 2021, Aurora, the first planned U.S. exascale system, is scheduled to be fired up at Argonne National Laboratory. Cray (now HPE) and Intel are the k Read more…

By John Russell

Nvidia’s Ampere A100 GPU: Up to 2.5X the HPC, 20X the AI

May 14, 2020

Nvidia's first Ampere-based graphics card, the A100 GPU, packs a whopping 54 billion transistors on 826mm2 of silicon, making it the world's largest seven-nanom Read more…

By Tiffany Trader

10nm, 7nm, 5nm…. Should the Chip Nanometer Metric Be Replaced?

June 1, 2020

The biggest cool factor in server chips is the nanometer. AMD beating Intel to a CPU built on a 7nm process node* – with 5nm and 3nm on the way – has been i Read more…

By Doug Black

Summit Supercomputer is Already Making its Mark on Science

September 20, 2018

Summit, now the fastest supercomputer in the world, is quickly making its mark in science – five of the six finalists just announced for the prestigious 2018 Read more…

By John Russell

TACC Supercomputers Run Simulations Illuminating COVID-19, DNA Replication

March 19, 2020

As supercomputers around the world spin up to combat the coronavirus, the Texas Advanced Computing Center (TACC) is announcing results that may help to illumina Read more…

By Staff report

  • arrow
  • Click Here for More Headlines
  • arrow
Do NOT follow this link or you will be banned from the site!
Share This