skip to main content
research-article

Compiler aided manual speculation for high performance concurrent data structures

Published:23 February 2013Publication History
Skip Abstract Section

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.

References

  1. Clang: A C language family frontend for LLVM. http://clang.llvm.org.Google ScholarGoogle Scholar
  2. H.-J. Boehm. Can seqlocks get along with programming language memory models? 2012 ACM SIGPLAN Workshop on Memory Systems Performance and Correctness, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  4. L. Dalessandro and M. L. Scott. Sandboxing transactional memory. 21st Intl. Conf. on Parallel Architectures and Compilation Techniques, Sep. 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  6. D. Dice, O. Shalev, and N. Shavit. Transactional locking II. 20th Intl. Symp. on Distributed Computing, Sep. 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. P. Felber, V. Gramoli, and R. Guerraoui. Elastic transactions. 23rd Intl. Conf. on Distributed Computing, Sep. 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  9. M. Herlihy and N. Shavit. The Art of Multiprocessor Programming. Morgan Kaufmann Publishers Inc., 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  11. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  12. M. Herlihy, N. Shavit, and M. Tzafrir. Hopscotch hashing. 22nd Intl. Symp. on Distributed Computing, Sep. 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  14. C. Lameter. Effective synchronization on Linux/NUMA systems. Gelato Federation Meeting, San Jose, CA, May 2005.Google ScholarGoogle Scholar
  15. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  16. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  17. 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 ScholarGoogle Scholar
  18. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  19. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  20. R. Pagh and F. F. Rodler. Cuckoo hashing. J. Algorithms, 51: 122--144, May 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  22. Y. Sagiv. Concurrent operations on B-trees with overtaking. 4th ACM SIGACT-SIGMOD Symp. on Principles of Database Systems, Mar. 1985. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  24. V. Srinivasan and M. J. Carey. Performance of B+ tree concurrency control algorithms. The VLDB Journal, 2: 361--406, Oct. 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. 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 ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Compiler aided manual speculation for high performance concurrent data structures

        Recommendations

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in

        Full Access

        • Published in

          cover image ACM SIGPLAN Notices
          ACM SIGPLAN Notices  Volume 48, Issue 8
          PPoPP '13
          August 2013
          309 pages
          ISSN:0362-1340
          EISSN:1558-1160
          DOI:10.1145/2517327
          Issue’s Table of Contents
          • cover image ACM Conferences
            PPoPP '13: Proceedings of the 18th ACM SIGPLAN symposium on Principles and practice of parallel programming
            February 2013
            332 pages
            ISBN:9781450319225
            DOI:10.1145/2442516

          Copyright © 2013 ACM

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 23 February 2013

          Check for updates

          Qualifiers

          • research-article

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader
        About Cookies On This Site

        We use cookies to ensure that we give you the best experience on our website.

        Learn more

        Got it!