Efficient Support for Strong Semantics in Transactional and Non-transactional Programs
Critical sections’ atomicity is enforced through locks or transactional memory (TM). Non-transactional programs have weak semantics in presence of data races under commonly used memory models like DRF0. Strong memory models like sequential consistency (SC), incur high implementation overhead and yet prove to me insufficient in eliminating concurrency bugs. TM programs have critical sections as atomic blocks. TM programs suffer from weak semantic behaviors especially in the interaction of transactional and non-transactional code. Guaranteeing strong semantics is expensive and the state of the art notion of strong semantics for TM programs still suffers from weak guarantees on relaxed memory models. Moreover, lock based programs often use TM for certain critical sections employing lock-elision. Furthermore, to enforce a strong memory model for a TM program with atomic blocks or non-transactional programs with locks, potentially different runtimes are required for each. Without a unified runtime, adding new atomic blocks to lock-based code is difficult prohibiting incremental deployment. Generally, enforcing strong semantics incurs high overhead. In this work, we propose a memory model that enforces stronger semantics than the state of the art and develop a single runtime to support TM and non-transactional programs. Our design and insights are aimed at efficiently enforcing this strong memory model for all programs by leveraging lightweight forms of atomicity that can be provided to critical sections and code regions of varying nature.