Abstract: “A functional programming discipline, combined with abstractions like Concurrent ML’s first-class synchronous events, offers an attractive programming model for shared-memory concurrency. In particular, synchronous message-passing eases the burden of coordinating and reasoning about concurrent threads by having a communication action serve double-duty as a both a data transfer mechanism (sending or receiving data on a typed channel) as well as a synchronization point (senders and receivers block until a matching action is available). In high-latency distributed environments, like the cloud, however, synchronous communication comes with a high price in performance, given the significant cost of communicating data from one node to another. While switching to an explicitly asynchronous communication model may reclaim some of the performance lost in a synchronous world, by helping to mask communication overheads, program structure and understanding also becomes more complex.
To ease the challenge of migrating concurrent applications to distributed cloud environments, we have built an extension of the MultiMLton compiler and runtime suitable that implements CML communication asynchronously, but guarantees that the resulting execution is faithful to the synchronous semantics of CML. We exploit MultiMLton’s support for lightweight checkpointing and rollback to integrate a notion of speculation that allows ill-formed executions to be re-executed, replacing offending asynchronous executions with safe synchronous ones. Several realistic case studies deployed on the Amazon EC2 demonstrate the utility of our approach.”