Open Transactional Actions: Interacting with Non-transactional Resources in STM Haskell
Jonathas Augusto de Oliveira Conceição

, André Rauber Du Bois

, Samuel da Silva Feitosa

, Gerson Geraldo Homrich Cavalheiro

, and Rodrigo Geraldo Ribeiro
(Federal University of Pelotas, Brazil; Federal University of Fronteira Sul, Brazil; Federal University of Ouro Preto, Brazil)
This paper addresses the problem of accessing external resources from inside transactions in STM Haskell, and for that purpose introduces a new abstraction called Open Transactional Actions (OTAs) that provides a framework for wrapping non-transactional resources in a transactional layer. OTAs allow the programmer to access resources through IO actions, from inside transactions, and also to register commit and abort handlers: the former are used to make the accesses to resources visible to other transactions at commit time, and the latter to undo changes in the resource if the transaction has to roll back. OTAs, once started, are guaranteed to be executed completely before the hosting transaction can be aborted, guarantying that if a resource is accessed, its respective commit and abort actions will be properly registered. We believe that OTAs could be used by expert programmers to implement useful system libraries and also to give a transactional semantics to fast linearizable data structures, i.e., transactional boosting. As a proof of concept, we present examples that use OTAs to implement transactional file access and transactional boosted data types that are faster than pure STM Haskell in most cases.
@InProceedings{Haskell22p54,
author = {Jonathas Augusto de Oliveira Conceição and André Rauber Du Bois and Samuel da Silva Feitosa and Gerson Geraldo Homrich Cavalheiro and Rodrigo Geraldo Ribeiro},
title = {Open Transactional Actions: Interacting with Non-transactional Resources in STM Haskell},
booktitle = {Proc.\ Haskell},
publisher = {ACM},
pages = {54--65},
doi = {10.1145/3546189.3549924},
year = {2022},
}
Publisher's Version
Info