skip to main content
10.1145/2755573.2755600acmconferencesArticle/Chapter ViewAbstractPublication PagesspaaConference Proceedingsconference-collections
research-article
Public Access

ThreadScan: Automatic and Scalable Memory Reclamation

Published:13 June 2015Publication History

ABSTRACT

The concurrent memory reclamation problem is that of devising a way for a deallocating thread to verify that no other concurrent threads hold references to a memory block being deallocated. To date, in the absence of automatic garbage collection, there is no satisfactory solution to this problem. Existing tracking methods like hazard pointers, reference counters, or epoch-based techniques like RCU, are either prohibitively expensive or require significant programming expertise, to the extent that implementing them efficiently can be worthy of a publication. None of the existing techniques are automatic or even semi-automated. In this paper, we take a new approach to concurrent memory reclamation: instead of manually tracking access to memory locations as done in techniques like hazard pointers, or restricting shared accesses to specific epoch boundaries as in RCU, our algorithm, called ThreadScan, leverages operating system signaling to automatically detect which memory locations are being accessed by concurrent threads. Initial empirical evidence shows that ThreadScan scales surprisingly well and requires negligible programming effort beyond the standard use of Malloc and Free.

References

  1. Yehuda Afek, Haim Kaplan, Boris Korenfeld, Adam Morrison, and Robert E. Tarjan. Cbtree: A practical concurrent self-adjusting search tree. In Proceedings of the 26th International Conference on Distributed Computing, DISC'12, pages 1--15, Berlin, Heidelberg, 2012. Springer-Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Dan Alistarh, Patrick Eugster, Maurice Herlihy, Alexander Matveev, and Nir Shavit. Stacktrack: An automated transactional approach to concurrent memory reclamation. In Proceedings of the Ninth European Conference on Computer Systems, EuroSys '14, pages 25:1--25:14, New York, NY, USA, 2014. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Dan Alistarh, Justin Kopinsky, Jerry Li, and Nir Shavit. The spraylist: A scalable relaxed priority queue. In 20th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, PPoPP 2015, San Francisco, CA, USA, 2015. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Hillel Avni, Nir Shavit, and Adi Suissa. Leaplist: Lessons learned in designing tm-supported range queries. In Proceedings of the 2013 ACM Symposium on Principles of Distributed Computing, PODC '13, pages 299--308, New York, NY, USA, 2013. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Stephen M. Blackburn and Kathryn S. McKinley. 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, pages 344--358, New York, NY, USA, 2003. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Hans-Juergen Boehm. Space efficient conservative garbage collection. In Proceedings of the ACM SIGPLAN 1993 Conference on Programming Language Design and Implementation, PLDI '93, pages 197--206, New York, NY, USA, 1993. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Anastasia Braginsky, Alex Kogan, and Erez Petrank. Drop the anchor: lightweight memory management for non-blocking data structures. In Proceedings of the 25th ACM symposium on Parallelism in algorithms and architectures, SPAA '13, pages 33--42, New York, NY, USA, 2013. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Perry Cheng and Guy E. Blelloch. A parallel, real-time garbage collector. In Proceedings of the ACM SIGPLAN 2001 Conference on Programming Language Design and Implementation, PLDI '01, pages 125--136, New York, NY, USA, 2001. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Austin T. Clements, M. Frans Kaashoek, and Nickolai Zeldovich. Scalable address spaces using rcu balanced trees. SIGPLAN Not., 47(4):199--210, March 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. David Detlefs, Paul A. Martin, Mark Moir, and Guy L. Steele Jr. Lock-free reference counting. Distributed Computing, 15(4):255--271, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. David L. Detlefs, Paul A. Martin, Mark Moir, and Guy L. Steele, Jr. Lock-free reference counting. In Proceedings of the twentieth annual ACM symposium on Principles of distributed computing, PODC '01, pages 190--199, New York, NY, USA, 2001. ACM. http://doi.acm.org/10.1145/383962.384016. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Aleksandar Dragojevic, Maurice Herlihy, Yossi Lev, and Mark Moir. On the power of hardware transactional memory to simplify memory management. In Proceedings of the 30th Annual ACM Symposium on Principles of Distributed Computing (PODC), pages 99--108, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Mikhail Fomitchev and Eric Ruppert. Lock-free linked lists and skip lists. In Proceedings of the 23rd annual ACM symposium on Principles of Distributed Computing (PODC' 04), pages 50--59, New York, NY, USA, 2004. ACM Press. http://doi.acm.org/10.1145/1011767.1011776. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Keir Fraser. Practical lock-freedom. Technical Report UCAM-CL-TR-579, University of Cambridge, Computer Laboratory, February 2004.Google ScholarGoogle Scholar
  15. Keir Fraser and Timothy L. Harris. Concurrent programming without locks. ACM Trans. Comput. Syst., 25(2), 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Sanjay Ghemawat and Paul Menage. Tcmalloc, Retrieved 2015. Available at http://goog-perftools.sourceforge.net/doc/tcmalloc.html.Google ScholarGoogle Scholar
  17. Anders Gidenstam, Marina Papatriantafilou, Håkan Sundell, and Philippas Tsigas. Efficient and reliable lock-free memory reclamation based on reference counting. IEEE Trans. Parallel Distrib. Syst., 20(8):1173--1187, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. V. Gramoli. More than you ever wanted to know about synchronization: Synchrobench. In Proceedings of the 20th Annual ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming (PPoPP), 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Sabine Hanke. The performance of concurrent red-black tree algorithms. In Jeffrey Vitter and Christos Zaroliagis, editors, Algorithm Engineering, volume 1668 of Lecture Notes in Computer Science, pages 286--300. Springer Berlin / Heidelberg, 1999. http://citeseer.ist.psu.edu/viewdoc/summary?doi=10.1.1.25.6504. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Tim L. Harris. A pragmatic implementation of non-blocking linked-lists. In Proceedings of the International Conference on Distributed Computing (DISC), pages 300--314, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Thomas E. Hart, Paul E. McKenney, Angela Demke Brown, and Jonathan Walpole. Performance of memory reclamation for lockless synchronization. J. Parallel Distrib. Comput., 67(12):1270--1285, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Steve Heller, Maurice Herlihy, Victor Luchangco, Mark Moir, William N. Scherer III, and Nir Shavit. A lazy concurrent list-based set algorithm. In James H. Anderson, Giuseppe Prencipe, and Roger Wattenhofer, editors, Proceedings of the 9th International Conference on Principles of Distributed Systems (OPODIS 2005), Revised Selected Papers, volume 3974 of Lecture Notes in Computer Science, pages 3--16. Springer, 2006. http://dx.doi.org/10.1007/11795490_3. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Maurice Herlihy, Yossi Lev, Victor Luchangco, and Nir Shavit. A simple optimistic skiplist algorithm. In Proceedings of the 14th international conference on Structural information and communication complexity, SIROCCO'07, pages 124--138, Berlin, Heidelberg, 2007. Springer-Verlag. http://dl.acm.org/citation.cfm?id=1760631.1760646. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Maurice Herlihy, Victor Luchangco, Paul Martin, and Mark Moir. Nonblocking memory management support for dynamic-sized data structures. ACM Trans. Comput. Syst., 23(2):146--196, May 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Maurice Herlihy and Nir Shavit. The Art of Multiprocessor Programming. Morgan Kaufmann Publishers Inc., San Francisco, CA, USA, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Maurice Herlihy, Nir Shavit, and Moran Tzafrir. Hopscotch hashing. In Proceedings of the 22nd international symposium on Distributed Computing, DISC '08, pages 350--364, Berlin, Heidelberg, 2008. Springer-Verlag. http://dl.acm.org/citation.cfm?id=1432316. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Michael Kerrisk. The Linux Programming Interface. No Starch Press, Inc., San Francisco, CA 94103, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Gabriel Kliot, Erez Petrank, and Bjarne Steensgaard. A lock-free, concurrent, and incremental stack scanning mechanism for garbage collectors. SIGOPS Oper. Syst. Rev., 43(3):3--13, July 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Doug Lea. Java concurrency package, 2005. Available at http://docs.oracle.com/javase/6/docs/api/java/util/concurrent/.Google ScholarGoogle Scholar
  30. Doug Lea, 2007. http://g.oswego.edu/dl/jsr166/dist/docs/java/util/concurrent/ConcurrentHashMap.html.Google ScholarGoogle Scholar
  31. Doug Lea, 2007. http://java.sun.com/javase/6/docs/api/java/util/concurrent/ConcurrentSkipListMap.html.Google ScholarGoogle Scholar
  32. I-Ting Angelina Lee, Silas Boyd-Wickizer, Zhiyi Huang, and Charles E. Leiserson. Using memory mapping to support cactus stacks in work-stealing runtime systems. In Valentina Salapura, Michael Gschwind, and Jens Knoop, editors, 19th International Conference on Parallel Architecture and Compilation Techniques (PACT 2010), Vienna, Austria, September 11--15, 2010, pages 411--420. ACM, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. William M. Leiserson. Threadscan git repository, 2015. Available at https://github.com/Willtor/ThreadScan.Google ScholarGoogle Scholar
  34. Yossi Levanoni and Erez Petrank. An on-the-fly reference-counting garbage collector for java. ACM Trans. Program. Lang. Syst., 28(1):1--69, January 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. Robert Love. Linux System Programming, 2nd Edition. O'Reilly Media, Sebastopol, CA 95472, 2013.Google ScholarGoogle Scholar
  36. P. E. McKenney, J. Appavoo, A. Kleen, O. Krieger, R. Russell, D. Sarma, and M. Soni. Read-copy update. In Proc. of the Ottawa Linux Symposium, page 338--367, 2001.Google ScholarGoogle Scholar
  37. Maged M. Michael. Hazard pointers: Safe memory reclamation for lock-free objects. IEEE Trans. Parallel Distrib. Syst., 15(6):491--504, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. Mark Moir and Nir Shavit. Concurrent data structures. Handbook of Data Structures and Applications, pages 47--14, 2007.Google ScholarGoogle Scholar
  39. Objective-C, 2014. http://en.wikipedia.org/wiki/Automatic_Reference_Counting.Google ScholarGoogle Scholar
  40. Mark Russinovich and David A. Solomon. Windows Internals: Including Windows Server 2008 and Windows Vista, Fifth Edition. Microsoft Press, 5th edition, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. Anthony Savidis. The implementation of generic smart pointers for advanced defensive programming. Softw., Pract. Exper., 34(10):977--1009, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. Ori Shalev and Nir Shavit. Split-ordered lists: Lock-free extensible hash tables. J. ACM, 53:379--405, May 2006. http://doi.acm.org/10.1145/1147954.1147958. Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. Nir Shavit and Itay Lotan. Skiplist-based concurrent priority queues. In Parallel and Distributed Processing Symposium, 2000. IPDPS 2000. Proceedings. 14th International, pages 263--268. IEEE, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. John D. Valois. Lock-free linked lists using compare-and-swap. In Proceedings of the 14th Annual ACM Symposium on Principles of Distributed Computing (PODC), pages 214--222, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. WIKI. http://en.wikipedia.org/wiki/Unix_signal.Google ScholarGoogle Scholar

Index Terms

  1. ThreadScan: Automatic and Scalable Memory Reclamation

      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
      • Published in

        cover image ACM Conferences
        SPAA '15: Proceedings of the 27th ACM symposium on Parallelism in Algorithms and Architectures
        June 2015
        362 pages
        ISBN:9781450335881
        DOI:10.1145/2755573
        • General Chair:
        • Guy Blelloch,
        • Program Chair:
        • Kunal Agrawal

        Copyright © 2015 ACM

        Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 13 June 2015

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • research-article

        Acceptance Rates

        SPAA '15 Paper Acceptance Rate31of131submissions,24%Overall Acceptance Rate447of1,461submissions,31%

        Upcoming Conference

        SPAA '24

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader