CoreDet
Tom Bergan, Owen T. Anderson, Joseph L. Devietti et al. · ACM SIGARCH Computer Architecture News · 2010
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.
Cited by 36 works. doi:10.1145/1735970.1736029
Authors
References
- The SPLASH-2 programs
- The PARSEC benchmark suite
- Algorithms for scalable synchronization on shared-memory multiprocessors
- Debugging Parallel Programs with Instant Replay
- The Java memory model
- A "flight data recorder" for enabling full-system multiprocessor deterministic replay
- Deterministic replay of Java multithreaded applications
- RecPlay
- Foundations of the C++ concurrency memory model
- Weak ordering---a new definition