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

Publikation: Bidrag til bog/antologi/rapport/konference proceedingKonferenceartikel i proceedingForskningpeer 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.
OriginalsprogEngelsk
TitelProceedings of the 9th European Lisp Symposium
RedaktørerIrène Durand
Antal sider8
ForlagEuropean Lisp Scientific Activities Association
Publikationsdato9 maj 2016
Sider65-72
Artikelnummer8
ISBN (Elektronisk)978-2-9557474-0-7
StatusUdgivet - 9 maj 2016
Begivenhed9th European Lisp Symposium - Department of Computer Science, AGH University of Science and Technology , Kraków, Polen
Varighed: 9 maj 201610 maj 2016
https://www.european-lisp-symposium.org/editions/2016/

Konference

Konference9th European Lisp Symposium
LokationDepartment of Computer Science, AGH University of Science and Technology
Land/OmrådePolen
ByKraków
Periode09/05/201610/05/2016
Internetadresse

Fingeraftryk

Dyk ned i forskningsemnerne om 'Extending Software Transactional Memory in Clojure with Side-Effects and Transaction Control'. Sammen danner de et unikt fingeraftryk.

Citationsformater