“Beautiful concurrency”

I just read Beautiful concurrency, an article by Simon Peyton Jones of MSR fame. MSR is interesting to me for a number of reasons — their fascination with Haskell among them.

This is a good introduction to software transactional memory (STM), presented in terms of the Haskell implementation. STM is an interesting model for concurrent programming. It is an alternative to lock-based concurrency that appears to have great promise for resolving many of the problems associated with locks.

For instance, lock-based code is known not to be composable: if foo() and bar() both lock on the same variable, the composition foo(bar()) will deadlock. However, STM allows for composition. By enabling composition, STM allows for more modularity in concurrent code. This is a good thing.

STM fits quite naturally into Haskell’s strange-but-pretty type system. Go read the article, it’s quite good.

Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: