Open Source Bridge Talk: Multicore Haskell Now

In June I had the opportunity to talk about approaches to parallel programming in Haskell at Open Source Bridge: “a new conference for developers working with open source technologies and for people interested in learning the open source way.”

Here are the slides (::PDF), and the source that accompanied the tutorial:

The abstract for  the session:

Haskell is a functional language built for parallel and concurrent programming. You can take an off-the-shelf copy of GHC and write high performance parallel programs right now. This tutorial will teach you how to exploit parallelism through Haskell on your commodity multicore machine, to make your code faster. We will introduce key parallel programming models, as implemented in Haskell, including:

  • semi-explicit parallelism via sparks
  • explicit parallelism via threads and shared memory
  • software transactional memory

and look at how to build faster programs using these abstractions. We will also look at the engineering considerations when writing parallel programs, and the tools Haskell provides for debugging and reasoning about parallel programs.

This is a hands on tutorial session: bring your laptops, there will be code!

Evaluation strategies and synchronization: things to watch for

A talk presented at the weekly Galois Developer Symposium.

The source of the talk and examples are all online.

This talk shows two areas relating to evaluation strategies in Haskell, and how they can subtly interact with threads, synchronization and performance. In addition, we briefly look at the interaction with asynchronous exceptions.

In particular,

  • Be careful with lazy values in synchronization variables
  • Consider using the strict-concurrency package for synchronization
  • All modify* functions should be very very carefully used
  • Interactions between async exceptions (e.g. block/killThread) and threads need expert eyes.