Abstract
We present a new algorithm for implementing a multi-word compare-and-swap functionality supporting the Read and CASN operations. The algorithm is wait-free under reasonable assumptions on execution history and benefits from new techniques to resolve conflicts between operations by using greedy helping and grabbing. Although the deterministic scheme for enabling grabbing somewhat sacrifices fairness, the effects are insignificant in practice. Moreover, unlike most of the previous results, the CASN operation does not require the list of addresses to be sorted before the operation is invoked, and the Read operation can read the current value without applying helping when the word to be read is within an ongoing transaction. Experiments using micro-benchmarks varying important parameters in three dimensions have been performed on two multiprocessor platforms. The results show similar performance as the lock-free algorithm by Harris et al. for most scenarios, and significantly better performance on scenarios with very high contention. This is altogether extraordinary good performance considering that the new algorithm is wait-free.
Similar content being viewed by others
References
Rajkumar R.: Synchronization in Real-Time Systems: A Priority Inheritance Approach. Kluwer, Dordrecht (1991)
Herlihy M.: Wait-free synchronization. ACM Trans. Program. Lang. Syst. 11(1), 124–149 (1991)
Israeli, A., Rappoport, L.: Disjoint-access-parallel implementations of strong shared memory primitives. In: Proceedings of the Thirteenth Annual ACM Symposium on Principles of Distributed Computing (Aug, 1994)
Shavit, N., Touitou, D.: Software transactional memory. In: Proceedings of the Fourteenth Annual ACM Symposium on Principles of Distributed Computing, ACM Press, pp. 204–213 (1995)
Anderson, J.H., Moir, M.: Universal constructions for multi-object operations. In: Proceedings of the 14th Annual ACM Symposium on the Principles of Distributed Computing (Aug, 1995)
Attiya, H., Dagan, E.: Universal operations: Unary versus binary. In: Proceedings of the 15th Annual ACM Symposium on Principles of Distributed Computing, pp. 223–232 (1996)
Attiya H., Dagan E.: Improved implementations of binary universal operations. J. ACM 48(5), 1013–1037 (2001)
Afek, Y., Merritt, M., Taubenfeld, G., Touitou, D.: Disentangling multi-object operations. In: Proceedings of the 16th Annual ACM Symposium on Principles of Distributed Computing, pp. 111–120 (1997)
Moir, M.: Transparent support for wait-free transactions. In: Proceedings of the 11th International Workshop on Distributed Algorithms. (Sep, 1997)
Harris, T., Fraser, K., Pratt, I.: A practical multi-word compare-and-swap operation. In: Proceedings of the 16th International Symposium on Distributed Computing (2002)
Ha, P.H., Tsigas, P.: Reactive multi-word synchronization for multiprocessors. J. Instr Lev Parallelism 6 (Apr, 2004)
Moir, M.: Practical implementations of non-blocking synchronization primitives. In: Proceedings of the 15th Annual ACM Symposium on the Principles of Distributed Computing (Aug, 1997)
Jayanti, P.: A complete and constant time wait-free implementation of CAS from LL/SC and vice versa. In: DISC 1998, pp. 216–230 (1998)
Valois, J.D.: Lock-Free Data Structures. PhD thesis, Rensselaer Polytechnic Institute, Troy, New York (1995)
Sundell, H.: Wait-free reference counting and memory management. In: Proceedings of the 19th International Parallel & Distributed Processing Symposium, IEEE (Apr, 2005)
Michael, M.M.: Practical lock-free and wait-free LL/SC/VL implementations using 64-bit CAS. In: Proceedings of the 18th International Conference on Distributed Computing, pp. 144–158 (2004)
Herlihy M., Wing J.: Linearizability: a correctness condition for concurrent objects. ACM Trans. Program. Lang. Syst. 12(3), 463–492 (1990)
Sundell H., Tsigas P.: Noble: non-blocking programming support via lock-free shared abstract data types. SIGARCH Comput. Archit. News 36(5), 80–87 (2008)
Author information
Authors and Affiliations
Corresponding author
Additional information
A preliminary and short version of this paper have appeared in the proceedings of the 2009 International Conference on Parallel and Distributed Processing Techniques and Applications.
Rights and permissions
About this article
Cite this article
Sundell, H. Wait-Free Multi-Word Compare-and-Swap Using Greedy Helping and Grabbing. Int J Parallel Prog 39, 694–716 (2011). https://doi.org/10.1007/s10766-011-0167-4
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10766-011-0167-4