AtomCaml
- 12 September 2005
- conference paper
- Published by Association for Computing Machinery (ACM)
- Vol. 40 (9) , 92-104
- https://doi.org/10.1145/1086365.1086378
Abstract
We have designed, implemented, and evaluated AtomCaml, an extension to Objective Caml that provides a synchronization primitive for atomic (transactional) execution of code. A first-class primitive function of type (unit-'a)-'a evaluates its argument (which may call other functions, even external C functions) as though no other thread has interleaved execution. Our design ensures fair scheduling and obstruction-freedom. Our implementation extends the Objective Caml bytecode compiler and run-time system to support atomicity. A logging-and-rollback approach lets us undo uncompleted atomic blocks upon thread pre-emption, and retry them when the thread is rescheduled. The mostly functional nature of the Caml language and the Objective Caml implementation's commitment to a uniprocessor execution model (i.e., threads are interleaved, not executed simultaneously) allow particularly efficient logging. We have evaluated the efficiency and ease-of-use of AtomCaml by writing libraries and microbenchmarks, writing a small application, and replacing all locking with atomicity in an existing, large multithreaded application. Our experience indicates the performance overhead is negligible, atomic helps avoid synchronization mistakes, and idioms such as condition variables adapt reasonably to the atomic approach.Keywords
This publication has 29 references indexed in Scilit:
- Dynamic state restoration using versioning exceptionsHigher-Order and Symbolic Computation, 2006
- Transactional Monitors for Concurrent ObjectsPublished by Springer Nature ,2004
- Language support for lightweight transactionsPublished by Association for Computing Machinery (ACM) ,2003
- Types for atomicityPublished by Association for Computing Machinery (ACM) ,2003
- Ownership types for safe programmingPublished by Association for Computing Machinery (ACM) ,2002
- Detecting data races in Cilk programs that use locksPublished by Association for Computing Machinery (ACM) ,1998
- EraserACM Transactions on Computer Systems, 1997
- A Debugger for Standard MLJournal of Functional Programming, 1995
- Guardians and Actions: Linguistic Support for Robust, Distributed ProgramsACM Transactions on Programming Languages and Systems, 1983
- ReductionCommunications of the ACM, 1975