Skip to main content
Log in

Wait-Free Multi-Word Compare-and-Swap Using Greedy Helping and Grabbing

  • Published:
International Journal of Parallel Programming Aims and scope Submit manuscript

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.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Subscribe and save

Springer+
from $39.99 /Month
  • Starting from 10 chapters or articles per month
  • Access and download chapters and articles from more than 300k books and 2,500 journals
  • Cancel anytime
View plans

Buy Now

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Rajkumar R.: Synchronization in Real-Time Systems: A Priority Inheritance Approach. Kluwer, Dordrecht (1991)

    MATH  Google Scholar 

  2. Herlihy M.: Wait-free synchronization. ACM Trans. Program. Lang. Syst. 11(1), 124–149 (1991)

    Article  Google Scholar 

  3. 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)

  4. 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)

  5. 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)

  6. 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)

  7. Attiya H., Dagan E.: Improved implementations of binary universal operations. J. ACM 48(5), 1013–1037 (2001)

    Article  MathSciNet  Google Scholar 

  8. 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)

  9. Moir, M.: Transparent support for wait-free transactions. In: Proceedings of the 11th International Workshop on Distributed Algorithms. (Sep, 1997)

  10. 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)

  11. Ha, P.H., Tsigas, P.: Reactive multi-word synchronization for multiprocessors. J. Instr Lev Parallelism 6 (Apr, 2004)

  12. 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)

  13. 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)

  14. Valois, J.D.: Lock-Free Data Structures. PhD thesis, Rensselaer Polytechnic Institute, Troy, New York (1995)

  15. Sundell, H.: Wait-free reference counting and memory management. In: Proceedings of the 19th International Parallel & Distributed Processing Symposium, IEEE (Apr, 2005)

  16. 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)

  17. Herlihy M., Wing J.: Linearizability: a correctness condition for concurrent objects. ACM Trans. Program. Lang. Syst. 12(3), 463–492 (1990)

    Article  Google Scholar 

  18. 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)

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Håkan Sundell.

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

Reprints 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

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10766-011-0167-4

Keywords