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

Hazard Pointers: Safe Memory Reclamation for Lock-Free Objects

Published: 01 June 2004 Publication History

Abstract

Abstract--Lock-free objects offer significant performance and reliability advantages over conventional lock-based objects. However, the lack of an efficient portable lock-free method for the reclamation of the memory occupied by dynamic nodes removed from such objects is a major obstacle to their wide use in practice. This paper presents hazard pointers, a memory management methodology that allows memory reclamation for arbitrary reuse. It is very efficient, as demonstrated by our experimental results. It is suitable for user-level applications--as well as system programs--without dependence on special kernel or scheduler support. It is wait-free. It requires only single-word reads and writes for memory access in its core operations. It allows reclaimed memory to be returned to the operating system. In addition, it offers a lock-free solution for the ABA problem using only practical single-word instructions. Our experimental results on a multiprocessor system show that the new methodology offers equal and, more often, significantly better performance than other memory management methods, in addition to its qualitative advantages regarding memory reclamation and independence of special hardware support. We also show that lock-free implementations of important object types, using hazard pointers, offer comparable performance to that of efficient lock-based implementations under no contention and no multiprogramming, and outperform them by significant margins under moderate multiprogramming and/or contention, in addition to guaranteeing continuous progress and availability, even in the presence of thread failures and arbitrary delays.

References

[1]
T.E. Anderson B.N. Bershad E.D. Lazowska and H.M. Levy, “Scheduler Activations: Effective Kernel Support for the User-Level Management of Parallelism,” ACM Trans. Computer Systems, vol. 10, no. 1, pp. 53-79, Feb. 1992.
[2]
T.H. Cormen C.E. Leiserson and R.L. Rivest, Introduction to Algorithms. MIT Press, 1990.
[3]
D.L. Detlefs P.A. Martin M. Moir and G.L. Steele Jr., “Lock-Free Reference Counting,” Proc. 20th Ann. ACM Symp. Principles of Distributed Computing, pp. 190-199, Aug. 2001.
[4]
M.B. Greenwald, “Non-Blocking Synchronization and System Design,” PhD thesis, Stanford Univ., Aug. 1999.
[5]
T.L. Harris, “A Pragmatic Implementation of Non-Blocking Linked Lists,” Proc. 15th Int'l Symp. Distributed Computing, pp.*nbsp;300-314, Oct. 2001.
[6]
T.L. Harris K. Fraser and I.A. Pratt, “A Practical Multi-Word Compare-and-Swap Operation,” Proc. 16th Int'l Symp. Distributed Computing, pp. 265-279, Oct. 2002.
[7]
D. Hendler and N. Shavit, “Work Dealing,” Proc. 14th Ann. ACM Symp. Parallel Algorithms and Architectures, pp. 164-172, Aug. 2002.
[8]
M.P. Herlihy, “Wait-Free Synchronization,” ACM Trans. Programming Languages and Systems, vol. 13, no. 1, pp. 124-149, Jan. 1991.
[9]
M.P. Herlihy, “A Methodology for Implementing Highly Concurrent Objects,” ACM Trans. Programming Languages and Systems, vol. 15, no. 5, pp. 745-770, Nov. 1993.
[10]
M.P. Herlihy V. Luchangco and M. Moir, “The Repeat Offender Problem: A Mechanism for Supporting Dynamic-Sized Lock-Free Data Structures,” Proc. 16th Int'l Symp. Distributed Computing, pp. 339-353, Oct. 2002.
[11]
IBM, IBM System/370 Extended Architecture, Principles of Operation, publicationno. SA22-7085, 1983.
[12]
L.I. Kontothanassis R.W. Wisniewski and M.L. Scott, “Scheduler-Conscious Synchronization,” ACM Trans. Computer Systems, vol. 15,no. 1, pp. 3-40, Feb. 1997.
[13]
P.E. McKenney and J.D. Slingwine, “Read-Copy Update: Using Execution History to Solve Concurrency Problems,” Proc. 10th IASTED Int'l Conf. Parallel and Distributed Computing and Systems, Oct. 1998.
[14]
J.M. Mellor-Crummey and M.L. Scott, “Algorithms for Scalable Synchronization on Shared-Memory Multiprocessors,” ACM Trans. Computer Systems, vol. 9, no. 1, pp. 21-65, Feb. 1991.
[15]
J.M. Mellor-Crummey and M.L. Scott, “Scalable Reader-Writer Synchronization for Shared-Memory Multiprocessors,” Proc. Third ACM Symp. Principles and Practice of Parallel Programming, pp. 106-113, Apr. 1991.
[16]
M.M. Michael, “High Performance Dynamic Lock-Free Hash Tables and List-Based Sets,” Proc. 14th Ann. ACM Symp. Parallel Algorithms and Architectures, pp. 73-82, Aug. 2002.
[17]
M.M. Michael, “Safe Memory Reclamation for Dynamic Lock-Free Objects Using Atomic Reads and Writes,” Proc. 21st Ann. ACM Symp. Principles of Distributed Computing, pp. 21-30, July 2002. earlier version in Research Report RC 22317, IBM T.J. Watson Research Center, Jan. 2002.
[18]
M.M. Michael, “CAS-Based Lock-Free Algorithm for Shared Deques,” Proc. Ninth Euro-Par Conf. Parallel Processing, pp. 651-660, Aug. 2003.
[19]
M.M. Michael, “ABA Prevention Using Single-Word Instructions,” Technical Report RC 23089, IBM T.J. Watson Research Center, Jan. 2004.
[20]
M.M. Michael, “Scalable Lock-Free Dynamic Memory Allocation,” Proc. 2004 ACM SIGPLAN Conf. Programming Language Design and Implementation, June 2004.
[21]
M.M. Michael and M.L. Scott, “Simple, Fast, and Practical Non-Blocking and Blocking Concurrent Queue Algorithms,” Proc. 15th Ann. ACM Symp. Principles of Distributed Computing, pp. 267-275, May 1996.
[22]
M.M. Michael and M.L. Scott, “Nonblocking Algorithms and Preemption-Safe Locking on Multiprogrammed Shared Memory Multiprocessors,” J. Parallel and Distributed Computing, vol. 51,no. 1, pp. 1-26, May 1998.
[23]
S. Prakash Y.-H. Lee and T. Johnson, “A Nonblocking Algorithm for Shared Queues Using Compare-and-Swap,” IEEE Trans. Computers, vol. 43, no. 5, pp. 548-559, May 1994.
[24]
L. Rudolph and Z. Segall, “Dynamic Decentralized Cache Schemes for MIMD Parallel Processors,” Proc. 11th Int'l Symp. Computer Architecture, pp. 340-347, June 1984.
[25]
O. Shalev and N. Shavit, “Split-Ordered Lists: Lock-Free Extensible Hash Tables,” Proc. 22nd Ann. ACM Symp. Principles of Distributed Computing, pp. 102-111, July 2003.
[26]
N. Shavit and D. Touitou, “Software Transactional Memory,” Distributed Computing, vol. 10, no. 2, pp. 99-116, 1997.
[27]
H. Tang K. Shen and T. Yang, “Program Transformation and Runtime Support for Threaded MPI Execution on Shared Memory Machines,” ACM Trans. Programming Languages and Systems, vol. 22,no. 4, pp. 673-700, July 2000.
[28]
J. Turek D. Shasha and S. Prakash, “Locking Without Blocking: Making Lock Based Concurrent Data Structure Algorithms Nonblocking,” Proc. 11th ACM Symp. Principles of Database Systems, pp. 212-222, June 1992.
[29]
J.D. Valois, “Lock-Free Linked Lists Using Compare-and-Swap,” Proc. 14th Ann. ACM Symp. Principles of Distributed Computing, pp. 214-222, Aug. 1995.
[30]
J. Zahorjan E.D. Lazowska and D.L. Eager, “The Effect of Scheduling Discipline on Spin Overhead in Shared Memory Parallel Systems,” IEEE Trans. Parallel and Distributed Systems, vol. 2,no. 2, pp. 180-198, Apr. 1991.

Cited By

View all
  • (2024)LeanStore: A High-Performance Storage Engine for NVMe SSDsProceedings of the VLDB Endowment10.14778/3685800.368591517:12(4536-4545)Online publication date: 1-Aug-2024
  • (2024)Concurrent Immediate Reference Counting (Abstract)Proceedings of the 2024 ACM Workshop on Highlights of Parallel Computing10.1145/3670684.3673408(3-4)Online publication date: 17-Jun-2024
  • (2024)Strongly Linearizable LL/SC from CASProceedings of the 43rd ACM Symposium on Principles of Distributed Computing10.1145/3662158.3662800(443-453)Online publication date: 17-Jun-2024
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image IEEE Transactions on Parallel and Distributed Systems
IEEE Transactions on Parallel and Distributed Systems  Volume 15, Issue 6
June 2004
94 pages

Publisher

IEEE Press

Publication History

Published: 01 June 2004

Author Tags

  1. 65
  2. Lock-free
  3. concurrent programming
  4. dynamic data structures.
  5. memory management
  6. multiprogramming
  7. synchronization

Qualifiers

  • Research-article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)0
  • Downloads (Last 6 weeks)0
Reflects downloads up to 09 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2024)LeanStore: A High-Performance Storage Engine for NVMe SSDsProceedings of the VLDB Endowment10.14778/3685800.368591517:12(4536-4545)Online publication date: 1-Aug-2024
  • (2024)Concurrent Immediate Reference Counting (Abstract)Proceedings of the 2024 ACM Workshop on Highlights of Parallel Computing10.1145/3670684.3673408(3-4)Online publication date: 17-Jun-2024
  • (2024)Strongly Linearizable LL/SC from CASProceedings of the 43rd ACM Symposium on Principles of Distributed Computing10.1145/3662158.3662800(443-453)Online publication date: 17-Jun-2024
  • (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)Brief Announcement: A Fast Scalable Detectable Unrolled Lock-Based Linked ListProceedings of the 36th ACM Symposium on Parallelism in Algorithms and Architectures10.1145/3626183.3660272(73-75)Online publication date: 17-Jun-2024
  • (2024)Expediting Hazard Pointers with Bounded RCU Critical SectionsProceedings of the 36th ACM Symposium on Parallelism in Algorithms and Architectures10.1145/3626183.3659941(1-13)Online publication date: 17-Jun-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)SplitDB: Closing the Performance Gap for LSM-Tree-Based Key-Value StoresIEEE Transactions on Computers10.1109/TC.2023.332698273:1(206-220)Online publication date: 1-Jan-2024
  • Show More Cited By

View Options

View options

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media