A Concurrent ML Library in Concurrent Haskell
| Citations: | 2 - 0 self |
BibTeX
@MISC{Chaudhuri_aconcurrent,
author = {Avik Chaudhuri},
title = { A Concurrent ML Library in Concurrent Haskell},
year = {}
}
OpenURL
Abstract
In Concurrent ML, synchronization abstractions can be defined and passed as values, much like functions in ML. This mechanism admits a fairly powerful, modular style of concurrent programming, called higher-order concurrent programming. Unfortunately, it is not clear whether this style of programming can be practiced in languages such as Concurrent Haskell, that support only first-order message passing. Indeed, the implementation of synchronization abstractions in Concurrent ML relies on fairly low-level, languagespecific details. Fortunately, it turns out that synchronization abstractions can in fact be supported in a language that supports only first-order message passing. We implement such a library in this paper. This library makes it possible to practice Concurrent ML-style programming directly in Concurrent Haskell. We begin with a core implementation of synchronization abstractions in the π-calculus, that serves as a foundation for other concrete implementations. Then, we extend this implementation to encode all of Concurrent ML’s concurrency primitives (and more!) in Concurrent Haskell. Our implementation is surprisingly efficient, even without possible optimizations. Preliminary experiments suggest that our library can consistently outperform a standard implementation of Concurrent ML-style primitives. At the heart of our implementation is a new distributed synchronization protocol that we prove correct. Unlike several previous translations of synchronization abstractions in concurrent languages, we remain faithful to the standard semantics for Concurrent ML’s concurrency primitives; for example, we retain the symmetry of choose, that is required to express generalized selective communication. As a corollary, we establish that implementing generalized selective communication on distributed machines is no harder than implementing first-order message passing on such machines.







