Monday, 30 November 2009

Parallel programming from OCaml using HLVM

Our HLVM project has hit another milestone with new support for parallel programming using threads.

HLVM threads and mutexes are a thin wrapper over POSIX threads. The mark+sweep garbage collector now uses a stop-the-world algorithm to suspend all mutator threads while a single thread traverses the entire heap marking and then traverses all allocated values reclaiming unmarked values. This is a very simple design and an unoptimized implementation but it already makes it possible to write parallel programs passing shared mutable state between threads by reference from OCaml.

No comments: