The Artima Developer Community
Sponsored Link

Java Community News
Simon Peyton-Jones on Transactional Memory

2 replies on 1 page. Most recent reply: Aug 8, 2007 10:42 AM by Alex Stojan

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 2 replies on 1 page
Frank Sommers

Posts: 2642
Nickname: fsommers
Registered: Jan, 2002

Simon Peyton-Jones on Transactional Memory Posted: Aug 6, 2007 2:20 PM
Reply to this message Reply
Summary
In his O'Reilly Open Source Conference keynote, Simon Peyton-Jones, one of the original designers of Haskell and a member of Microsoft Research's Cambridge lab, discusses transactional memory, a new method of writing concurrent programs.
Advertisement

One of the fathers of Haskell, Simon Peyton-Jones was among the first to implement transactional memory in the Haskell language. As he explains in his O'Reilly Open-Source Conference keynote, transactional memory is a concept taken from the database community, and now applied as a memory management technique for program execution. O'Reilly recently posted the video of Peyton-Jones' presentation.

Peyton-Jones starts out by discussing the need for an effective programming model for parallel programs, and then discusses the problems with current approaches:

You can broadly think of two ways of building parallel programs. You can use task parallelism, in which you spawn off multiple threads, each with its own program counter, and then you have to arrange for those threads to communicate and synchronize with each other. Or, else, you can do data parallelism, which means doing the same thing, that is, a single program counter, on lots of bits of data at the same time...

Here's the strange thing about task parallelism: The state of the art in making threads communicate and synchronize with each other, is fundamentally, thirty years ago. There's been very little progress in the last thirty years, even though we've been thinking for a long time that it's a hard problem... and a problem where the current solution is not very satisfactory.

The current solution is locks and condition variables. They're sometimes called synchronize methods or monitors... They are fundamentally flawed I think... because they don't compose well. That is, you can't build big programs by gluing together small programs that already work.

Peyton-Jones then describes a new way of writing parallel programs made possible with the advent of transactional memory:

In the last few years, an idea came about, which is called transactional memory... a new way [of] writing parallel programs...

We're going to take some sequential code, all the code that would work in a sequential program, and just wrap atomic{} around it. It's just an idea taken from the database people... We're just going to do a transaction against memory, not against the database...

The code inside those curly braces is going to execute with an all-or-nothing semantics. That's going to give it atomicity, and is going to isolate it. While that code is running, it's not going to see changes to the states of global variables that are affected by other threads... It can't deadlock, because there are no locks...

What do you think of transactional memory as a concurrency technique?


Greg Wilson

Posts: 6
Nickname: gvwilson
Registered: Oct, 2005

Re: Simon Peyton-Jones on Transactional Memory Posted: Aug 6, 2007 5:36 PM
Reply to this message Reply
SPJ describes transactional memory (and the motivation behind it) at length in O'Reilly's new book "Beautiful Code" (http://www.oreilly.com/catalog/9780596510046/).

Alex Stojan

Posts: 95
Nickname: alexstojan
Registered: Jun, 2005

Re: Simon Peyton-Jones on Transactional Memory Posted: Aug 8, 2007 10:42 AM
Reply to this message Reply
It's also at http://research.microsoft.com/~simonpj/papers/stm/beautiful.pdf

Flat View: This topic has 2 replies on 1 page
Topic: Should Java Provide Internal Iterators? Previous Topic   Next Topic Topic: Todd Hoff on the Coming of the Shards

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use