A new version of the Glasgow Haskell Compiler (GHC 6.12.1) has been released today and is available for download here. It supports Linux, Windows 2000/XP/Vista (and perhaps Windows 7 will run that version okay too..?), and MacOS X.
I’ve blogged previously about why Haskell is great for multicore programming. This latest version of GHC incorporates some changes to optimise compiler performance for parallel programs. Language changes have been made in this release (and some features are starting to be described as deprecated, with support to be withdrawn in future), but these do not appear to affect parallel programming adversely.
Here are some edited highlights from the full release notes:
- Considerably improved support for parallel execution. GHC 6.10 would execute parallel Haskell programs, but performance was often not very good. Simon Marlow has done lots of performance tuning in 6.12, removing many of the accidental (and largely invisible) gotchas that made parallel programs run slowly.
- As part of this parallel-performance tuning, Satnam Singh and Simon Marlow have developed ThreadScope, a GUI that lets you see what is going on inside your parallel program. It’s a huge step forward from “It takes 4 seconds with 1 processor, and 3 seconds with 8 processors; now what?”. ThreadScope will be released separately from GHC, but at more or less the same time as GHC 6.12.
- The flag +RTS -N now automatically determines how many threads to use, based on the number of CPUs in your machine.
- The parallel GC now uses the same threads as the mutator, with the consequence that you can no longer select a different number of threads to use for GC. The -gn RTS option has been removed, except that -g1 is still accepted for backwards compatibility.
- The new flag +RTS -qggen sets the minimum generation for which parallel garbage collection is used. Defaults to 1. The flag -qg on its own disables parallel GC.
- The new flag +RTS -qbgen controls load balancing in the parallel GC. (There are more details on all these garbage collection options here).
- There is a new statistic in the +RTS -s output that tells you how many sparks (requests for parallel execution, caused by calls to par) were created, how many were actually evaluated in parallel (converted), and how many were found to be already evaluated and were thus discarded (pruned). Any unaccounted for sparks are simply discarded at the end of evaluation.
- There is a new flag -feager-blackholing which typically gives better performing code when running with multiple threads. See “Compile-time options for SMP parallelism” for more information.
- The threadsafe foreign import safety level is now deprecated; use safe instead.
- The new flag +RTS -qa uses the OS to set thread affinity (experimental).






RSS - Posts