Abstract
Speculation is a well-known means of increasing parallelism among concurrent methods that are usually but not always independent. Traditional nonblocking data structures employ a particularly restrictive form of speculation. Software transactional memory (STM) systems employ a much more general---though typically blocking---form, and there is a wealth of options in between.
Using several different concurrent data structures as examples, we show that manual addition of speculation to traditional lock-based code can lead to significant performance improvements. Successful speculation requires careful consideration of profitability, and of how and when to validate consistency. Unfortunately, it also requires substantial modifications to code structure and a deep understanding of the memory model. These latter requirements make it difficult to use in its purely manual form, even for expert programmers. To simplify the process, we present a compiler tool, CSpec, that automatically generates speculative code from baseline lock-based code with user annotations. Compiler-aided manual speculation keeps the original code structure for better readability and maintenance, while providing the flexibility to chose speculation and validation strategies. Experiments on UltraSPARC and x86 platforms demonstrate that with a small number annotations added to lock-based code, CSpec can generate speculative code that matches the performance of best-effort hand-written versions.
- Clang: A C language family frontend for LLVM. http://clang.llvm.org.Google Scholar
- H.-J. Boehm. Can seqlocks get along with programming language memory models? 2012 ACM SIGPLAN Workshop on Memory Systems Performance and Correctness, 2012. Google Scholar
Digital Library
- N. G. Bronson, J. Casper, H. Chafi, and K. Olukotun. A practical concurrent binary search tree. 15th ACM SIGPLAN Symp. on Principles and Practice of Parallel Programming, Jan. 2010. Google Scholar
Digital Library
- L. Dalessandro and M. L. Scott. Sandboxing transactional memory. 21st Intl. Conf. on Parallel Architectures and Compilation Techniques, Sep. 2012. Google Scholar
Digital Library
- L. Dalessandro, M. L. Scott, and M. F. Spear. Transactions as the foundation of a memory consistency model. 24th Intl. Symp. on Distributed Computing, Sep. 2010. Google Scholar
Digital Library
- D. Dice, O. Shalev, and N. Shavit. Transactional locking II. 20th Intl. Symp. on Distributed Computing, Sep. 2006. Google Scholar
Digital Library
- P. Felber, V. Gramoli, and R. Guerraoui. Elastic transactions. 23rd Intl. Conf. on Distributed Computing, Sep. 2009. Google Scholar
Digital Library
- R. Guerraoui and M. Kapałka. On the correctness of transactional memory. 13th ACM SIGPLAN Symp. on Principles and Practice of Parallel Programming, Feb. 2008. Google Scholar
Digital Library
- M. Herlihy and N. Shavit. The Art of Multiprocessor Programming. Morgan Kaufmann Publishers Inc., 2008. Google Scholar
Digital Library
- M. Herlihy, V. Luchangco, and M. Moir. Obstruction-free synchronization: Double-ended queues as an example. 23rd Intl. Conf. on Distributed Computing Systems, May 2003. Google Scholar
Digital Library
- M. Herlihy, V. Luchangco, M. Moir, and W. N. Scherer III. Software transactional memory for dynamic-sized data structures. 22nd ACM Symp. on Principles of Distributed Computing, July 2003. Google Scholar
Digital Library
- M. Herlihy, N. Shavit, and M. Tzafrir. Hopscotch hashing. 22nd Intl. Symp. on Distributed Computing, Sep. 2008. Google Scholar
Digital Library
- M. P. Herlihy and J. M. Wing. Linearizability: A correctness condition for concurrent objects. ACM Trans. Program. Lang. Syst., 12: 463--492, July 1990. Google Scholar
Digital Library
- C. Lameter. Effective synchronization on Linux/NUMA systems. Gelato Federation Meeting, San Jose, CA, May 2005.Google Scholar
- P. L. Lehman and S. B. Yao. Efficient locking for concurrent operations on B-trees. ACM Trans. Database Syst., 6: 650--670, Dec. 1981. Google Scholar
Digital Library
- V. J. Marathe, M. F. Spear, and M. L. Scott. Scalable techniques for transparent privatization in software transactional memory. Intl. Conf. on Parallel Processing, Sep. 2008. Google Scholar
Digital Library
- P. E. McKenney, J. Appavoo, A. Kleen, O. Krieger, R. Russel, D. Sarma, and M. Soni. Read-copy update. Ottawa Linux Symp., July 2001.Google Scholar
- J. M. Mellor-Crummey and M. L. Scott. Scalable reader-writer synchronization for shared-memory multiprocessors. 3rd ACM SIGPLAN Symp. on Principles and Practice of Parallel Programming, Apr. 1991. Google Scholar
Digital Library
- M. M. Michael and M. L. Scott. Simple, fast, and practical non-blocking and blocking concurrent queue algorithms. 15th ACM Symp. on Principles of Distributed Computing, May 1996. Google Scholar
Digital Library
- R. Pagh and F. F. Rodler. Cuckoo hashing. J. Algorithms, 51: 122--144, May 2004. Google Scholar
Digital Library
- T. Riegel, C. Fetzer, and P. Felber. Time-based transactional memory with scalable time bases. 19th ACM Symp. on Parallel Algorithms and Architectures, June 2007. Google Scholar
Digital Library
- Y. Sagiv. Concurrent operations on B-trees with overtaking. 4th ACM SIGACT-SIGMOD Symp. on Principles of Database Systems, Mar. 1985. Google Scholar
Digital Library
- M. F. Spear, V. J. Marathe, W. N. Scherer III, and M. L. Scott. Conflict detection and validation strategies for software transactional memory. 20th Intl. Symp. on Distributed Computing, Sep. 2006. Google Scholar
Digital Library
- V. Srinivasan and M. J. Carey. Performance of B+ tree concurrency control algorithms. The VLDB Journal, 2: 361--406, Oct. 1993. Google Scholar
Digital Library
- P. R. Wilson, M. S. Johnstone, M. Neely, and D. Boles. Dynamic storage allocation: A survey and critical review. Intl. Workshop on Memory Management, Sep. 1995. Google Scholar
Digital Library
Index Terms
Compiler aided manual speculation for high performance concurrent data structures
Recommendations
Compiler aided manual speculation for high performance concurrent data structures
PPoPP '13: Proceedings of the 18th ACM SIGPLAN symposium on Principles and practice of parallel programmingSpeculation is a well-known means of increasing parallelism among concurrent methods that are usually but not always independent. Traditional nonblocking data structures employ a particularly restrictive form of speculation. Software transactional ...
Boosting SMT Performance by Speculation Control
IPDPS '01: Proceedings of the 15th International Parallel and Distributed Processing Symposium (IPDPS'01) - Volume 1Simultaneous Multithreading (SMT) is a technique that permits multiple threads to execute in parallel within a single processor. Usually, an SMT processor uses shared instruction queues to collect instructions from the different threads. Hence, an SMT ...







Comments