skip to main content
article

FRC: a high-performance concurrent parallel deferred reference counter for C++

Published:18 June 2018Publication History
Skip Abstract Section

Abstract

We present FRC, a high-performance concurrent parallel reference counter for unmanaged languages. It is well known that high-performance garbage collectors help developers write memory-safe, highly concurrent systems and data structures. While C++, C, and other unmanaged languages are used in high-performance applications, adding concurrent memory management to these languages has proven to be difficult. Unmanaged languages like C++ use pointers instead of references, and have uncooperative mutators which do not pause easily at a safe point. Thus, scanning mutator stack root references is challenging.

FRC only defers decrements and does not require mutator threads to pause during collection. By deferring only decrements, FRC avoids much of the synchronization overhead of a fully-deferred implementation. Root references are scanned without interrupting the mutator by publishing these references to a thread-local array. FRC's performance can exceed that of the C++ standard library's shared pointer by orders of magnitude. FRC's thread-safety guarantees and low synchronization overhead enable significant throughput gains for concurrently-readable shared data structures.

We describe the components of FRC, including our static tree router data structure: a novel barrier which improves the scalability of parallel collection workers. FRC's performance is evaluated on several concurrent data structures. We release FRC and our tests as open-source code and expect FRC will be useful for many concurrent C++ software systems.

References

  1. Nikolas Askitis. 2012. Cache-conscious String Data Structures, Sorting and Algorithms: theory and practice. http://web.archive.org/web/20120206015921/http://www.naskitis.com/Google ScholarGoogle Scholar
  2. David F. Bacon, Clement R. Attanasio, Han B. Lee, V. T. Rajan, and Stephen Smith. 2001. Java Without the Coffee Breaks: A Nonintrusive Multiprocessor Garbage Collector. In Proceedings of the ACM SIGPLAN 2001 Conference on Programming Language Design and Implementation (PLDI '01). ACM, New York, NY, USA, 92-103. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Stephen M. Blackburn and Kathryn S. McKinley. 2003. Ulterior Reference Counting: Fast Garbage Collection Without a Long Wait. In Proceedings of the 18th Annual ACM SIGPLAN Conference on Object-oriented Programing, Systems, Languages, and Applications (OOPSLA '03). ACM, New York, NY, USA, 344-358. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Stephen M. Blackburn and Kathryn S. McKinley. 2008. Immix: A Mark-Region Garbage Collector with Space Efficiency, Fast Collection, and Mutator Performance. In ACM Conference on Programming Language Design and Implementation (PLDI '08). ACM, 22-32. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Hans-J. Boehm. 2002. Bounding Space Usage of Conservative Garbage Collectors. In Proceedings of the 29th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL '02). ACM, New York, NY, USA, 93-100. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Hans-Juergen Boehm. 2004. The Space Cost of Lazy Reference Counting. In Proceedings of the 31st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL '04). ACM, New York, NY, USA, 210-219. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Hans-Juergen Boehm and Mark Weiser. 1988. Garbage Collection in an Uncooperative Environment. Softw. Pract. Exper. 18, 9 (Sept. 1988), 807-820. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. George E. Collins. 1960. A Method for Overlapping and Erasure of Lists. Commun. ACM 3, 12 (Dec. 1960), 655-657. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. David Detlefs, Christine Flood, Steve Heller, and Tony Printezis. 2004. Garbage-first Garbage Collection. In Proceedings of the 4th International Symposium on Memory Management (ISMM '04). ACM, New York, NY, USA, 37-48. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. L. Peter Deutsch and Daniel G. Bobrow. 1976. An Efficient, Incremental, Automatic Garbage Collector. Commun. ACM 19, 9 (Sept. 1976), 522-526. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Daniel Frampton. 2010. Garbage Collection and the Case for High-level Low-level Programming. Ph.D. Dissertation. Australian National University.Google ScholarGoogle Scholar
  12. Ivan Jibaja, Stephen M. Blackburn, Mohammad R. Haghighat, and Kathryn S. McKinley. 2011. Deferred Gratification: Engineering for High Performance Garbage Collection from the Get Go. In Proceedings of the 2011 ACM SIGPLAN Workshop on Memory Systems Performance and Correctness (MSPC '11). ACM, New York, NY, USA, 58-65. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Ryan Johnson, Ippokratis Pandis, Nikos Hardavellas, Anastasia Ailamaki, and Babak Falsafi. 2009. Shore-MT: A Scalable Storage Manager for the Multicore Era. In Proceedings of the 12th International Conference on Extending Database Technology: Advances in Database Technology (EDBT '09). ACM, New York, NY, USA, 24-35. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Yossi Levanoni and Erez Petrank. 2001. An On-the-fly Reference Counting Garbage Collector for Java. In Proceedings of the 16th ACM SIGPLAN Conference on Object-oriented Programming, Systems, Languages, and Applications (OOPSLA '01). ACM, New York, NY, USA, 367-380. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. John McCarthy. 1960. Recursive Functions of Symbolic Expressions and Their Computation by Machine, Part I. Commun. ACM 3, 4 (April 1960), 184-195. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Maged M. Michael. 2004. Hazard Pointers: Safe Memory Reclamation for Lock-Free Objects. IEEE Trans. Parallel Distrib. Syst. 15, 6 (June 2004), 491-504. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Jon Rafkind, Adam Wick, John Regehr, and Matthew Flatt. 2009. Precise Garbage Collection for C. In Proceedings of the 2009 International Symposium on Memory Management (ISMM '09). ACM, New York, NY, USA, 39-48. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Rifat Shahriyar, Stephen M. Blackburn, and Daniel Frampton. 2012. Down for the Count? Getting Reference Counting Back in the Ring. In Proceedings of the 2012 International Symposium on Memory Management (ISMM '12). ACM, New York, NY, USA, 73-84. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Rifat Shahriyar, Stephen M. Blackburn, and Kathryn S. McKinley. 2014. Fast Conservative Garbage Collection. In Proceedings of the 2014 ACM International Conference on Object Oriented Programming Systems Languages & Applications (OOPSLA '14). ACM, New York, NY, USA, 121- 139. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Rifat Shahriyar, Stephen Michael Blackburn, Xi Yang, and Kathryn S. McKinley. 2013. Taking off the Gloves with Reference Counting Immix. In Proceedings of the 2013 ACM SIGPLAN International Conference on Object Oriented Programming Systems Languages & Applications (OOPSLA '13). ACM, New York, NY, USA, 93-110. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Paul R. Wilson. 1992. Uniprocessor Garbage Collection Techniques. In Proceedings of the International Workshop on Memory Management (IWMM '92). Springer-Verlag, London, UK, UK, 1-42. http://dl.acm.org/citation.cfm?id=645648.664824 Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. FRC: a high-performance concurrent parallel deferred reference counter for C++

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 53, Issue 5
    ISMM '18
    May 2018
    119 pages
    ISSN:0362-1340
    EISSN:1558-1160
    DOI:10.1145/3299706
    Issue’s Table of Contents
    • cover image ACM Conferences
      ISMM 2018: Proceedings of the 2018 ACM SIGPLAN International Symposium on Memory Management
      June 2018
      119 pages
      ISBN:9781450358019
      DOI:10.1145/3210563

    Copyright © 2018 ACM

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    • Published: 18 June 2018

    Check for updates

    Qualifiers

    • 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!