Abstract
In conjunction with the increase of multi-core processors the use of functional programming languages has increased in recent years. The functional language Clojure has concurrency as a core feature, and provides Software Transactional Memory (STM) as a substitute for locks. Transactions in Clojure do however not support execution of code with side-effects and provide no methods for synchronising threads. Additional concurrency mechanisms on top of STM are needed for these use cases, increasing the complexity of the code. We present multiple constructs allowing functions with side-effects to be executed as part of a transaction. These constructs are made accessible through a uniform interface, making them interchangeable. We present constructs providing explicit control of transactions. Through these constructs transactions can synchronise threads based on the current program state, abort a transaction, and provide an alternative path of execution if a transaction is forced to restart. eClojure is the implementation of these constructs in Clojure 1.8, and it is tested using an additional set of unit tests. With a series of use cases we show that the addition of these constructs provides additional capabilities to Clojure's STM implementation without violating its ACI properties. Through a usability evaluation with a small sample size we show that using these constructs reduces both the number of lines of code and the development time compared to Clojure 1.8. Last we demonstrate through a preliminary performance benchmark that the addition of these constructs adds only a constant overhead to the STM implementation.
Original language | English |
---|---|
Title of host publication | Proceedings of the 9th European Lisp Symposium |
Editors | Irène Durand |
Number of pages | 8 |
Publisher | European Lisp Scientific Activities Association |
Publication date | 9 May 2016 |
Pages | 65-72 |
Article number | 8 |
ISBN (Electronic) | 978-2-9557474-0-7 |
Publication status | Published - 9 May 2016 |
Event | 9th European Lisp Symposium - Department of Computer Science, AGH University of Science and Technology , Kraków, Poland Duration: 9 May 2016 → 10 May 2016 https://www.european-lisp-symposium.org/editions/2016/ |
Conference
Conference | 9th European Lisp Symposium |
---|---|
Location | Department of Computer Science, AGH University of Science and Technology |
Country/Territory | Poland |
City | Kraków |
Period | 09/05/2016 → 10/05/2016 |
Internet address |
Keywords
- Clojure, MVCC, STM, Side-Effects, Transaction Control