Extending Software Transactional Memory in Clojure with Side-Effects and Transaction Control

Research output: Contribution to book/anthology/report/conference proceedingArticle in proceedingResearchpeer-review

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 languageEnglish
Title of host publicationProceedings of the 9th European Lisp Symposium
EditorsIrène Durand
Number of pages8
PublisherEuropean Lisp Scientific Activities Association
Publication date9 May 2016
Pages65-72
Article number8
ISBN (Electronic)978-2-9557474-0-7
Publication statusPublished - 9 May 2016
Event9th European Lisp Symposium - Department of Computer Science, AGH University of Science and Technology , Kraków, Poland
Duration: 9 May 201610 May 2016
https://www.european-lisp-symposium.org/editions/2016/

Conference

Conference9th European Lisp Symposium
LocationDepartment of Computer Science, AGH University of Science and Technology
Country/TerritoryPoland
CityKraków
Period09/05/201610/05/2016
Internet address

Keywords

  • Clojure, MVCC, STM, Side-Effects, Transaction Control

Fingerprint

Dive into the research topics of 'Extending Software Transactional Memory in Clojure with Side-Effects and Transaction Control'. Together they form a unique fingerprint.

Cite this