R. Lyndon While, A. J. Field
Parallel pattern matching provides true commutative implementation of functions defined by cases in functional languages, because no argument is given precedence over any other. We present a formal semantics of parallel pattern matching and describe an implementation in Haskell that maps individual argument component matches into Concurrent Haskell threads. The performance of the Concurrent Haskell implementation is evaluated via benchmarking. The requirement for concurrency (in general) to support the semantics means that current implementations can often incur a significant performance penalty compared with sequential schemes, such as left-to-right matching. We describe a source-level program transformation scheme that analyses a parallel pattern matching definition and is often able to generate an equivalent definition that can be executed within a single thread. Where sequential implementation is not possible, the scheme is sometimes able to generate an equivalent definition that reduces the number of concurrent threads required.
pubs.doc.ic.ac.uk: built & maintained by Ashok Argent-Katwala.