Affiliation:
1. University of Washington, Computer Science and Engineering, Seattle, WA, USA
Abstract
The behavior of a multithreaded program does not depend only on its inputs. Scheduling, memory reordering, timing, and low-level hardware effects all introduce nondeterminism in the execution of multithreaded programs. This severely complicates many tasks, including debugging, testing, and automatic replication. In this work, we avoid these complications by eliminating their root cause: we develop a compiler and runtime system that runs arbitrary multithreaded C/C++ POSIX Threads programs deterministically.
A trivial non-performant approach to providing determinism is simply deterministically serializing execution. Instead, we present a compiler and runtime infrastructure that ensures determinism but resorts to serialization rarely, for handling interthread communication and synchronization. We develop two basic approaches, both of which are largely dynamic with performance improved by some static compiler optimizations. First, an ownership-based approach detects interthread communication via an evolving table that tracks ownership of memory regions by threads. Second, a buffering approach uses versioned memory and employs a deterministic commit protocol to make changes visible to other threads. While buffering has larger single-threaded overhead than ownership, it tends to scale better (serializing less often). A hybrid system sometimes performs and scales better than either approach individually.
Our implementation is based on the LLVM compiler infrastructure. It needs neither programmer annotations nor special hardware. Our empirical evaluation uses the PARSEC and SPLASH2 benchmarks and shows that our approach scales comparably to nondeterministic execution.
Publisher
Association for Computing Machinery (ACM)
Reference28 articles.
1. Weak ordering---a new definition
2. Hoard
3. The PARSEC benchmark suite
4. G. Blelloch. NESL: A Nested Data-Parallel Language (Version 3.1). Technical report Carnegie Mellon University Pittsburgh PA. G. Blelloch. NESL: A Nested Data-Parallel Language (Version 3.1). Technical report Carnegie Mellon University Pittsburgh PA.
Cited by
19 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Requirements-preserving design automation for multiprocessor embedded system applications;Journal of Ambient Intelligence and Humanized Computing;2020-06-05
2. Sparse record and replay with controlled scheduling;Proceedings of the 40th ACM SIGPLAN Conference on Programming Language Design and Implementation;2019-06-08
3. Lazy Determinism for Faster Deterministic Multithreading;Proceedings of the Twenty-Fourth International Conference on Architectural Support for Programming Languages and Operating Systems;2019-04-04
4. Taming Parallelism in a Multi-Variant Execution Environment;Proceedings of the Twelfth European Conference on Computer Systems;2017-04-23
5. Intention preservation in deterministic multithreading: a partial solution;IET Software;2016-12