Strong Atomicity: an Efficient and Easy-to-Use Mechanism to Guarantee Atomicity

Kai Lu,Wenzhe Zhang,Xu Zhou
DOI: https://doi.org/10.1109/csss.2012.146
2012-01-01
Abstract:Atomicity violation, a common bug that obsesses multithreaded programs, has made the developing of multithreaded programs a daunting task. Atomicity is a basic correctness property of such programs. We propose strong atomicity, an efficient mechanism that helps programmers to write correct atom blocks with very little effort. We provide atom_start and atom_end for programmers to annotate an atom block. And then our runtime system will efficiently execute the block while guaranteeing atomicity. Unlike transactional memory (TM), strong atomicity permits asymmetrical atomic code regions, which means the execution of atom block not only excludes other atom blocks, but also excludes any other instructions outside atom blocks. Hence, programmers only need to simply wrap the key code region without worrying about the conflicts from outside, which saves programming effort. We have implemented our system and evaluated it with some use cases (writing or fixing multithreaded programs). With the help of our mechanism, writing an atom block is straightforward. Just wrap the block with atom_start and atom_end and it will behave like an atom operation.
What problem does this paper attempt to address?