Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
article

Nonblocking memory management support for dynamic-sized data structures

Published: 01 May 2005 Publication History

Abstract

Conventional dynamic memory management methods interact poorly with lock-free synchronization. In this article, we introduce novel techniques that allow lock-free data structures to allocate and free memory dynamically using any thread-safe memory management library. Our mechanisms are lock-free in the sense that they do not allow a thread to be prevented from allocating or freeing memory by the failure or delay of other threads. We demonstrate the utility of these techniques by showing how to modify the lock-free FIFO queue implementation of Michael and Scott to free unneeded memory. We give experimental results that show that the overhead introduced by such modifications is moderate, and is negligible under low contention.

References

[1]
Agesen, O., Detlefs, D., Flood, C., Garthwaite, A., Martin, P., Moir, M., Shavit, N., and Steele, G. 2002. DCAS-based concurrent deques. Theory of Computing Systems 35, 349--386. (A preliminary version appeared in the Proceedings of the 12th ACM Symposium on Parallel Algorithms and Architectures, 2000.)
[2]
Anderson, J. and Moir, M. 1997. Using local-spin k-exclusion algorithms to improve wait-free object implementations. Distrib. Comput. 11, 1--20. (A preliminary version appeared in Proceedings of the 13th Annual ACM Symposium on Principles of Distributed Computing, 1994, pp. 141--150.)
[3]
Anderson, J. and Moir, M. 1999. Universal constructions for large objects. IEEE Trans. Paral. Distrib. Syst. 10, 12, 1317--1332. (A preliminary version appeared in the Proceedings of the 9th Annual International Workshop on Distributed Algorithms, 1995.)
[4]
Bacon, D. F., Attanasio, C. R., Lee, H. B., Rajan, V. T., and Smith, S. 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. ACM, New York, 92--103.
[5]
Detlefs, D., Flood, C., Garthwaite, A., Martin, P., Shavit, N., and Steele, G. 2000. Even better DCAS-based concurrent deques. In Proceedings of the 14th International Conference on Distributed Computing. 59--73.
[6]
Detlefs, D., Martin, P., Moir, M., and Steele, G. 2001. Lock-free reference counting. In Proceedings of the 20th Annual ACM Symposium on Principles of Distributed Computing. ACM, New York, 190--199.
[7]
Dice, D. and Garthwaite, A. 2002. Mostly lock-free malloc. In Proceedings of the ACM SIGPLAN International Symposium on Memory Management. ACM, New York.
[8]
Doherty, S., Groves, L., Luchangco, V., and Moir, M. 2004a. Formal verification of a practical lock-free queue algorithm. In Proceedings of the 24th Annual International Conference on Formal Techniques for Networked and Distributed Systems (FORTE). Lecture Notes in Computer Science, Vol. 3235, Springer Verlag, New York, 97--114.
[9]
Doherty, S., Herlihy, M., Luchangco, V., and Moir, M. 2004b. Bringing practical lock-free synchronization to 64-bit applications. In Proceedings of the 23rd Annual ACM Symposium on Principles of Distributed Computing. ACM, New York, 31--39.
[10]
Greenwald, M. 1999. Non-blocking synchronization and system design. Ph.D. dissertation, Stanford University Tech. Rep. STAN-CS-TR-99-1624, Palo Alto, Calif.
[11]
Harris, T. 2001. A pragmatic implementation of non-blocking linked lists. In Proceedings of the 15th International Symposium on Distributed Computing.
[12]
Herlihy, M. 1991. Wait-free synchronization. ACM Trans. Prog. Lang. and Systems 13, 1, 124--149.
[13]
Herlihy, M., Luchangco, V., Martin, P., and Moir, M. 2002. Brief announcement: Dynamic-sized lock-free data structures. In Proceedings of the 21st ACM Symposium on Principles of Distributed Computing (PODC 2002). ACM, New York, 131.
[14]
Herlihy, M., Luchangco, V., and Moir, M. 2003. Space- and time-adaptive nonblocking algorithms. In Proceedings of Computing: The Australasian Theory Symposium (CATS).
[15]
Lamport, L. 1979. How to make a multiprocessor computer that correctly executes multiprocess programs. IEEE Trans. Comput. C-28, 9 (Sept.), 241--248.
[16]
Lea, D. 2003. Concurrency jsr-166 interest site. http://gee.cs.oswego.edu/dl/concurrency-interest/.
[17]
Lynch, N. and Tuttle, M. 1989. An introduction to input/output automata. Tech. Rep. CWI-Quarterly, 2(3), Centrum voor Wiskunde en Informatica, Amsterdam, The Netherlands.
[18]
Martinez, J. F. and Torrellas, J. 2002. Speculative synchronization: Applying thread-level speculation to explicitly parallel applications. In Proceedings of the 10th International Conference on Architectural Support for Programming Languages and Operating Systems.
[19]
Michael, M. 2002a. Safe memory reclamation for dynamic lock-free objects using atomic reads and writes. In Proceedings of the 21st Annual ACM Symposium on the Principles of Distributed Computing. ACM, New York, 21--30.
[20]
Michael, M. M. 2002b. High performance dynamic lock-free hash tables and list-based sets. In Proceeding of the 14th Annual Symposium on Parallel Algorithms and Architectures. ACM, New York, 73--82.
[21]
Michael, M. 2004. Hazard pointers: Safe memory reclamation for lock-free objects. IEEE Trans. Parall. Distrib. Syst. 15, 6 (June), 491--504.
[22]
Michael, M. and Scott, M. 1996. Simple, fast, and practical non-blocking and blocking concurrent queue algorithms. In Proceedings of the 15th Annual ACM Symposium on the Principles of Distributed Computing. ACM, New York, 267--276.
[23]
Michael, M. and Scott, M. 1998. Nonblocking algorithms and preemption-safe locking on multiprogrammed shared memory multiprocessors. J. Paral. Distrib. Comput. 51, 1, 1--26.
[24]
Moir, M. 1997. Practical implementations of non-blocking synchronization primitives. In Proceedings of the 16th Annual ACM Symposium on Principles of Distributed Computing. ACM, New York, 219--228.
[25]
Oplinger, J., and Lam, M. S. 2002. Enhancing software reliability with speculative threads. In Proceedings of the 10th International Conference on Architectural Support for Programming Languages and Operating Systems.
[26]
Printezis, T. and Detlefs, D. 2000. A generational mostly-concurrent garbage collector. In Proceedings of the 2nd International Symposium on Memory Management. ACM, New York, 143--154.
[27]
Rajwar, R. and Goodman, J. R. 2002. Transactional lock-free execution of lock-based programs. In Proceedings of the 10th International Conference on Architectural Support for Programming Languages and Operating Systems.
[28]
Treiber, R. 1986. Systems programming: Coping with parallelism. Tech. Rep. RJ5118, IBM Almaden Research Center.
[29]
Valois, J. 1995. Lock-free linked lists using compare-and-swap. In Proceedings of the 14th Annual ACM Symposium on Principles of Distributed Computing. ACM, New York, 214--222. (See http://www.cs.sunysb.edu/~valois for errata.)
[30]
Weaver, D., and Germond, T. 1994. The SPARC Architecture Manual Version 9. Prentice-Hall, Englewood Cliffs, N.J.

Cited By

View all
  • (2024)A Family of Fast and Memory Efficient Lock- and Wait-Free ReclamationProceedings of the ACM on Programming Languages10.1145/36588518:PLDI(2174-2198)Online publication date: 20-Jun-2024
  • (2024)Concurrent Immediate Reference CountingProceedings of the ACM on Programming Languages10.1145/36563838:PLDI(151-174)Online publication date: 20-Jun-2024
  • (2024)Are Your Epochs Too Epic? Batch Free Can Be HarmfulProceedings of the 29th ACM SIGPLAN Annual Symposium on Principles and Practice of Parallel Programming10.1145/3627535.3638491(30-41)Online publication date: 2-Mar-2024
  • Show More Cited By

Recommendations

Reviews

Sergei Gorlatch

An in-depth discussion of a new mechanism for lock-free data structures that allow memory to be freed dynamically is presented in this paper. Lock-free algorithms do not rely on locking for thread safety, but instead use certain atomic operations (usually provided in hardware), such as compare-and-swap. While lock-free algorithms avoid many problems caused by locking, a common problem is that data structures cannot easily be shrunk because they can be used by other threads concurrently. The paper proposes a simple mechanism and application programming interface (API) to overcome this problem: prior to using a data item, threads post a guard on the item and release this guard only when they do not use the reference anymore. Before a data item can be released, a special "liberate" method is called to check that the item is not guarded by any other thread. The paper applies the presented mechanisms to two examples: a simple stack implementation, which serves as an initial illustrating example, and the lock-free first in first out (FIFO) queue algorithm of Michael and Scott. The paper provides an implementation for the proposed scheme, and presents a correctness proof for the implementation. The authors also present experimental results, documenting that the cost incurred by the presented mechanisms is negligible under low contention, and modest for high contention. In addition to the FIFO case study, a general methodology (single-word lock-free reference counting) is also presented. The paper provides a great deal of insight into the problems (and solutions) of lock-free data structures, and also provides many pointers to related work. Online Computing Reviews Service

Access critical reviews of Computing literature here

Become a reviewer for Computing Reviews.

Comments

Information & Contributors

Information

Published In

cover image ACM Transactions on Computer Systems
ACM Transactions on Computer Systems  Volume 23, Issue 2
May 2005
108 pages
ISSN:0734-2071
EISSN:1557-7333
DOI:10.1145/1062247
Issue’s Table of Contents

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 May 2005
Published in TOCS Volume 23, Issue 2

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Multiprocessors
  2. concurrent data structures
  3. dynamic data structures
  4. memory management
  5. nonblocking synchronization

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)17
  • Downloads (Last 6 weeks)2
Reflects downloads up to 05 Jan 2025

Other Metrics

Citations

Cited By

View all
  • (2024)A Family of Fast and Memory Efficient Lock- and Wait-Free ReclamationProceedings of the ACM on Programming Languages10.1145/36588518:PLDI(2174-2198)Online publication date: 20-Jun-2024
  • (2024)Concurrent Immediate Reference CountingProceedings of the ACM on Programming Languages10.1145/36563838:PLDI(151-174)Online publication date: 20-Jun-2024
  • (2024)Are Your Epochs Too Epic? Batch Free Can Be HarmfulProceedings of the 29th ACM SIGPLAN Annual Symposium on Principles and Practice of Parallel Programming10.1145/3627535.3638491(30-41)Online publication date: 2-Mar-2024
  • (2024)Simple, Fast and Widely Applicable Concurrent Memory Reclamation via NeutralizationIEEE Transactions on Parallel and Distributed Systems10.1109/TPDS.2023.333567135:2(203-220)Online publication date: 1-Feb-2024
  • (2024)A Fast Wait-Free Solution to Read-Reclaim Races in Reference CountingEuro-Par 2024: Parallel Processing10.1007/978-3-031-69583-4_8(103-118)Online publication date: 26-Aug-2024
  • (2023)Smarter Atomic Smart Pointers: Safe and Efficient Concurrent Memory Management (Abstract)Proceedings of the 2023 ACM Workshop on Highlights of Parallel Computing10.1145/3597635.3598027(9-10)Online publication date: 18-Jul-2023
  • (2023)The ERA Theorem for Safe Memory ReclamationProceedings of the 2023 ACM Symposium on Principles of Distributed Computing10.1145/3583668.3594564(102-112)Online publication date: 19-Jun-2023
  • (2023)Practically and Theoretically Efficient Garbage Collection for MultiversioningProceedings of the 28th ACM SIGPLAN Annual Symposium on Principles and Practice of Parallel Programming10.1145/3572848.3577508(66-78)Online publication date: 25-Feb-2023
  • (2023)Applying Hazard Pointers to More Concurrent Data StructuresProceedings of the 35th ACM Symposium on Parallelism in Algorithms and Architectures10.1145/3558481.3591102(213-226)Online publication date: 17-Jun-2023
  • (2023)Releasing Memory with Optimistic Access: A Hybrid Approach to Memory Reclamation and Allocation in Lock-Free ProgramsProceedings of the 35th ACM Symposium on Parallelism in Algorithms and Architectures10.1145/3558481.3591089(177-186)Online publication date: 17-Jun-2023
  • Show More Cited By

View Options

Login options

Full Access

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media