Hazard pointers: Safe memory reclamation for lock-free objects

被引:238
作者
Michael, MM [1 ]
机构
[1] IBM Corp, Thomas J Watson Res Ctr, Yorktown Hts, NY 10598 USA
关键词
lock-free; synchronization; concurrent programming; memory management; multiprogramming; dynamic data structures;
D O I
10.1109/TPDS.2004.8
中图分类号
TP301 [理论、方法];
学科分类号
081202 ;
摘要
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.
引用
收藏
页码:491 / 504
页数:14
相关论文
共 24 条
[1]   SCHEDULER ACTIVATIONS - EFFECTIVE KERNEL SUPPORT FOR THE USER-LEVEL MANAGEMENT OF PARALLELISM [J].
ANDERSON, TE ;
BERSHAD, BN ;
LAZOWSKA, ED ;
LEVY, HM .
ACM TRANSACTIONS ON COMPUTER SYSTEMS, 1992, 10 (01) :53-79
[2]  
[Anonymous], 2005, SOC NETWORKS, DOI [DOI 10.1016/j.socnet.2004.11.009, DOI 10.1016/J.SOCNET.2004.11.009]
[3]  
Detlefs D. L., 2001, P 20 ANN ACM S PRINC, P190, DOI [10.1145/383962.384016, DOI 10.1145/383962.384016]
[4]  
Harris T., 2001, Proceedings of the 15th International Conference on Distributed Computing, P300
[5]  
Hendler D., 2002, P 14 ANN ACM S PAR A, P164, DOI DOI 10.1145/564870.564900
[6]   A METHODOLOGY FOR IMPLEMENTING HIGHLY CONCURRENT DATA OBJECTS [J].
HERLIHY, M .
ACM TRANSACTIONS ON PROGRAMMING LANGUAGES AND SYSTEMS, 1993, 15 (05) :745-770
[7]   WAIT-FREE SYNCHRONIZATION [J].
HERLIHY, M .
ACM TRANSACTIONS ON PROGRAMMING LANGUAGES AND SYSTEMS, 1991, 13 (01) :124-149
[8]   Scheduler-conscious synchronization [J].
Kontothanassis, LI ;
Wisniewski, RW ;
Scott, ML .
ACM TRANSACTIONS ON COMPUTER SYSTEMS, 1997, 15 (01) :3-40
[9]   ALGORITHMS FOR SCALABLE SYNCHRONIZATION ON SHARED-MEMORY MULTIPROCESSORS [J].
MELLORCRUMMEY, JM ;
SCOTT, ML .
ACM TRANSACTIONS ON COMPUTER SYSTEMS, 1991, 9 (01) :21-65
[10]  
MELLORCRUMMEY JM, 1991, PPOPP 91, P106, DOI DOI 10.1145/109625.109637