AbstractSince the introduction of multicore processors, programmers can no longer rely on increasing clock frequencies to make their programs run faster "for free". Instead, they have to explicitly use concurrency. However, concurrent programming is notoriously difficult. To this end, developers can use concurrency models: techniques that introduce parallelism in a controlled manner and provide guarantees to prevent common errors such as race conditions and deadlocks. In this dissertation, we look at three concurrency models from three categories: futures (which guarantee determinacy), transactions (which guarantee isolation and progress), and actors (which guarantee the isolated turn principle and deadlock freedom).
An empirical study has shown that existing programs and programming languages often combine multiple concurrency models. We study these combinations and show that they can annihilate the guarantees of their constituent models. Hence, the assumptions of developers are invalidated and the errors that were prevented by the separate concurrency models can resurface. For each combination, we examine which guarantees are broken when used in a naive, ad-hoc combination. Next, we study how the guarantees of both models can be maintained without limiting performance. We focus on two interesting cases in particular.
First, the combination of transactions and futures leads to transactional futures: futures created in a transaction with access to the encompassing transactional context. Using transactional futures, parallelism inside transactions can be exploited, benefitting from determinacy within the transaction and isolation between transactions.
Second, the combination of transactions and actors leads to transactional actors. These make it possible both to create transactions in actors, and vice versa, to send messages to actors in transactions. Our semantics maintains the isolation and progress guarantees of transactions, while guaranteeing low-level race freedom and deadlock freedom for the actors.
Finally, we combine all three models into one unified framework, called Chocola (COmposable COncurrency LAnguage), which we implemented as an extension of Clojure. We specify the operational semantics of Chocola and demonstrate its properties. Starting from three benchmarks from the commonly used STAMP benchmark suite, we demonstrate that by combining multiple concurrency models using Chocola, additional parallelism can be introduced in these programs, while requiring only a small effort from the developer.
To the best of our knowledge, this dissertation is the first to comprehensively study the combination of three radically different concurrency models – futures, transactions, and actors – and specify a semantics for their combinations that aims to introduce additional parallelism while maintaining their guarantees wherever possible. Using Chocola, developers can freely pick and mix the appropriate concurrency models for their use cases.
|Date of Award||27 Sep 2018|
|Supervisor||Wolfgang De Meuter (Promotor), Joeri De Koster (Promotor), Viviane Jonckers (Jury), Beat Signer (Jury), Jan Lemeire (Jury), Mira Mezini (Jury) & Hridesh Rajan (Jury)|