ABA Prevention Using Single-Word Instructions
暂无分享,去创建一个
The ABA problem is a fundamental problem that affects almost all lock-free algorithms. The atomic primitives LL/SC/VL (Load-Linked, Store-Conditional, Validate) offer a convenient way for algorithm designers to reason about lock-free algorithms, without concern for the ABA problem. However, for practical architectural reasons, no processor architecture supports the ideal semantics of LL/VL/SC. It is relatively easy to implement LL/SC/VL—and prevent the ABA problem—using double-word atomic instructions. However, most current mainstream 64-bit architectures support only single-word atomic instructions. The best known constructions of LL/SC/VL using singleword instructions entail substantial space overhead when applied to a large number of memory locations, and require knowing the maximum number of threads in advance. This report presents simple lock-free constructions using only practical single-word instructions for implementing ideal LL/SC/VL, and hence preventing the ABA problem, with reasonable space overhead. These constructions can also be used to implement arbitrary width atomic operations.
[1] Maurice Herlihy,et al. The Repeat Offender Problem: A Mechanism for Supporting Dynamic-Sized, Lock-Free Data Structures , 2002, DISC.
[2] Prasad Jayanti,et al. Efficient and practical constructions of LL/SC variables , 2003, PODC '03.
[3] Maged M. Michael. Safe memory reclamation for dynamic lock-free objects using atomic reads and writes , 2002, PODC '02.