Skip to main content

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 8913))

Abstract

To synthesize the topics in previous chapters of this book, we now turn to the question of how to use transactions in real-world code. We use a concrete example, transactionalization of the memcached application, as a vehicle for exploring the challenges and benefits that arise from using transactions instead of locks. Specific topics that receive attention in this chapter include irrevocability, contention management, language-level semantics and privatization, write-through and write-back algorithms, and condition synchronization.

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

Access this chapter

eBook
USD 16.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Adl-Tabatabai, A.R., Luchangco, V., Marathe, V.J., Moir, M., Narayanaswamy, R., Ni, Y., Nussbaum, D., Tian, X., Welc, A., Wu, P.: Exceptions and Transactions in C++. In: Proceedings of the First USENIX Workshop on Hot Topics in Parallelism, Berkeley, CA (March 2009)

    Google Scholar 

  2. Adl-Tabatabai, A.R., Shpeisman, T., Gottschlich, J.: Draft Specification of Transactional Language Constructs for C++, version 1.1 (February 2012), http://justingottschlich.com/tm-specification-for-c-v-1-1/

  3. Adl-Tabatabai, A.R.: Shpeisman (Eds.), T.: Draft Specification of Transactional Language Constructs for C++, version 1.0 (August 2009), http://software.intel.com/file/21569

  4. Afek, Y., Drepper, U., Felber, P., Fetzer, C., Gramoli, V., Hohmuth, M., Riviere, E., Stenstrom, P., Unsal, O., Maldonado, W., Harmanci, D., Marlier, P., Diestelhorst, S., Pohlack, M., Cristal, A., Hur, I., Dragojevic, A., Guerraoui, R., Kapalka, M., Tomic, S., Korland, G., Shavit, N., Nowack, M., Riegel, T.: The velox transactional memory stack. In: Proceedings of the 43rd IEEE/ACM International Symposium on Microarchitecture, Atlanta, GA (December 2010)

    Google Scholar 

  5. Ansari, M., Kotselidis, C., Jarvis, K., Lujan, M., Kirkham, C., Watson, I.: Lee-TM: A Non-trivial Benchmark for Transactional Memory. In: Proceedings of the International Conference on Algorithms and Architectures for Parallel Processing, Ayia Napa, Cyprus (June 2008)

    Google Scholar 

  6. Attiya, H., Epstein, L., Shachnai, H., Tamir, T.: Transactional contention management as a non-clairvoyant scheduling problem. In: Proceedings of the 25th ACM Symposium on Principles of Distributed Computing, Denver, CO (August 2006)

    Google Scholar 

  7. Carlstrom, B.D., McDonald, A., Chafi, H., Chung, J., Minh, C.C., Kozyrakis, C., Olukotun, K.: The Atomos Transactional Programming Language. In: Proceedings of the 27th ACM Conference on Programming Language Design and Implementation, Ottawa, ON (June 2006)

    Google Scholar 

  8. Charles, P., Donawa, C., Ebcioglu, K., Grothoff, C., Kielstra, A., von Praun, C., Saraswat, V., Sarkar, V.: X10: An Object-Oriented Approach to Non-Uniform Cluster Computing. In: Proceedings of the 20th ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications, San Diego, CA (October 2005)

    Google Scholar 

  9. Dalessandro, L., Spear, M., Scott, M.L.: NOrec: Streamlining STM by Abolishing Ownership Records. In: Proceedings of the 15th ACM Symposium on Principles and Practice of Parallel Programming, Bangalore, India (January 2010)

    Google Scholar 

  10. Dice, D., Shavit, N.: TLRW: Return of the Read-Write Lock. In: Proceedings of the 22nd ACM Symposium on Parallelism in Algorithms and Architectures, Santorini, Greece (June 2010)

    Google Scholar 

  11. Dragojevic, A., Herlihy, M., Lev, Y., Moir, M.: On The Power of Hardware Transactional Memory to Simplify Memory Management. In: Proceedings of the 30th ACM Symposium on Principles of Distributed Computing, San Jose, CA (June 2011)

    Google Scholar 

  12. Dragojevic, A., Ni, Y., Adl-Tabatabai, A.R.: Optimizing Transactions for Captured Memory. In: Proceedings of the 21st ACM Symposium on Parallelism in Algorithms and Architectures, Calgary, AB, Canada (August 2009)

    Google Scholar 

  13. Dudnik, P., Swift, M.M.: Condition Variables and Transactional Memory: Problem or Opportunity? In: Proceedings of the 4th ACM SIGPLAN Workshop on Transactional Computing, Raleigh, NC (February 2009)

    Google Scholar 

  14. Felber, P., Fetzer, C., Riegel, T.: Dynamic Performance Tuning of Word-Based Software Transactional Memory. In: Proceedings of the 13th ACM Symposium on Principles and Practice of Parallel Programming, Salt Lake City, UT (February 2008)

    Google Scholar 

  15. Fich, F.E., Luchangco, V., Moir, M., Shavit, N.: Obstruction-free Algorithms Can Be Practically Wait-free. In: Proceedings of the 19th International Symposium on Distributed Computing, Cracow, Poland (September 2005)

    Google Scholar 

  16. Guerraoui, R., Kapalka, M.: On the Correctness of Transactional Memory. In: Proceedings of the 13th ACM Symposium on Principles and Practice of Parallel Programming, Salt Lake City, UT (February 2008)

    Google Scholar 

  17. Guerraoui, R., Kapalka, M., Vitek, J.: STMBench7: A Benchmark for Software Transactional Memory. In: Proceedings of the EuroSys 2007 Conference, Lisbon, Portugal (March 2007)

    Google Scholar 

  18. Harris, T., Marlow, S., Peyton Jones, S., Herlihy, M.: Composable Memory Transactions. In: Proceedings of the 10th ACM Symposium on Principles and Practice of Parallel Programming, Chicago, IL (June 2005)

    Google Scholar 

  19. Herlihy, M.P., Luchangco, V., Moir, M., Scherer III, W.N.: Software Transactional Memory for Dynamic-sized Data Structures. In: Proceedings of the 22nd ACM Symposium on Principles of Distributed Computing, Boston, MA (July 2003)

    Google Scholar 

  20. Hong, S., Oguntebi, T., Casper, J., Bronson, N., Kozyrakis, C., Olukotun, K.: Eigenbench: A Simple Exploration Tool for Orthogonal TM Characteristics. In: Proceedings of the IEEE International Symposium on Workload Characterization, Atlanta, GA (December 2010)

    Google Scholar 

  21. Kestor, G., Stipic, S., Unsal, O., Cristal, A., Valero, M.: RMS-TM: A Transactional Memory Benchmark for Recognition, Mining and Synthesis Applications. In: Proceedings of the 4th ACM SIGPLAN Workshop on Transactional Computing, Raleigh, NC (February 2009)

    Google Scholar 

  22. Liu, Y., Spear, M.: Toxic Transactions. In: Proceedings of the 6th ACM SIGPLAN Workshop on Transactional Computing, San Jose, CA (June 2011)

    Google Scholar 

  23. Luchangco, V., Marathe, V.: Transaction Communicators: Enabling Cooperation Among Concurrent Transactions. In: Proceedings of the 16th ACM Symposium on Principles and Practice of Parallel Programming, San Antonio, TX (February 2011)

    Google Scholar 

  24. Lupei, D., Simion, B., Pinto, D., Misler, M., Burcea, M., Krick, W., Amza, C.: Transactional Memory Support for Scalable and Transparent Parallelization of Multiplayer Games. In: Proceedings of the EuroSys2010 Conference, Paris, France (April 2010)

    Google Scholar 

  25. Mathewson, N., Provos, N.: Libevent – An Event Notification Library (2011–2013), http://libevent.org/

  26. McKenney, P.E., Michael, M.M., Walpole, J.: Why The Grass Not Be Greener On The Other Side: A Comparison of Locking vs. Transactional Memory. In: Proceedings of the 4th ACM SIGOPS Workshop on Programming Languages and Operating Systems, Stevenson, WA (October 2007)

    Google Scholar 

  27. Menon, V., Balensiefer, S., Shpeisman, T., Adl-Tabatabai, A.R., Hudson, R., Saha, B., Welc, A.: Practical Weak-Atomicity Semantics for Java STM. In: Proceedings of the 20th ACM Symposium on Parallelism in Algorithms and Architectures, Munich, Germany (June 2008)

    Google Scholar 

  28. Miletic, N., Smiljkovic, V., Perfumo, C., Harris, T., Cristal, A., Hur, I., Unsal, O., Valero, M.: Transactification of a Real-World System Library. In: Proceedings of the 5th ACM SIGPLAN Workshop on Transactional Computing, Paris, France (April 2010)

    Google Scholar 

  29. Minh, C.C., Chung, J., Kozyrakis, C., Olukotun, K.: STAMP: Stanford Transactional Applications for Multi-processing. In: Proceedings of the IEEE International Symposium on Workload Characterization, Seattle, WA (September 2008)

    Google Scholar 

  30. Moravan, M., Bobba, J., Moore, K., Yen, L., Hill, M., Liblit, B., Swift, M., Wood, D.: Supporting Nested Transactional Memory in LogTM. In: Proceedings of the 12th International Conference on Architectural Support for Programming Languages and Operating Systems, San Jose, CA (October 2006)

    Google Scholar 

  31. Ni, Y., Welc, A., Adl-Tabatabai, A.R., Bach, M., Berkowits, S., Cownie, J., Geva, R., Kozhukow, S., Narayanaswamy, R., Olivier, J., Preis, S., Saha, B., Tal, A., Tian, X.: Design and Implementation of Transactional Constructs for C/C++. In: Proceedings of the 23rd ACM Conference on Object Oriented Programming, Systems, Languages, and Applications, Nashville, TN (October 2008)

    Google Scholar 

  32. Pankratius, V., Adl-Tabatabai, A.R.: A Study of Transactional Memory vs. Locks in Practice. In: Proceedings of the 23rd ACM Symposium on Parallelism in Algorithms and Architectures, San Jose, CA (June 2011)

    Google Scholar 

  33. Poettering, L.: Measuring Lock Contention (2009–2013), http://0pointer.de/blog/projects/mutrace.html

  34. Pohlack, M., Diestelhorst, S.: From Lightweight Hardware Transactional Memory to Lightweight Lock Elision. In: Proceedings of the 6th ACM SIGPLAN Workshop on Transactional Computing, San Jose, CA (June 2011)

    Google Scholar 

  35. Riegel, T., Fetzer, C., Felber, P.: Automatic Data Partitioning in Software Transactional Memories. In: Proceedings of the 20th ACM Symposium on Parallelism in Algorithms and Architectures, Munich, Germany (June 2008)

    Google Scholar 

  36. Rossbach, C., Hofmann, O., Witchel, E.: Is Transactional Programming Really Easier? In: Proceedings of the 15th ACM Symposium on Principles and Practice of Parallel Programming, Bangalore, India (January 2010)

    Google Scholar 

  37. Ruan, W., Vyas, T., Liu, Y., Spear, M.: Transactionalizing Legacy Code: An Experience Report Using GCC and Memcached. In: Proceedings of the 19th International Conference on Architectural Support for Programming Languages and Operating Systems, Salt Lake City, UT (March 2014)

    Google Scholar 

  38. Saha, B., Adl-Tabatabai, A.R., Hudson, R.L., Minh, C.C., Hertzberg, B.: McRT-STM: A High Performance Software Transactional Memory System For A Multi-Core Runtime. In: Proceedings of the 11th ACM Symposium on Principles and Practice of Parallel Programming, New York, NY (March 2006)

    Google Scholar 

  39. Scherer III, W.N., Scott, M.L.: Advanced Contention Management for Dynamic Software Transactional Memory. In: Proceedings of the 24th ACM Symposium on Principles of Distributed Computing, Las Vegas, NV (July 2005)

    Google Scholar 

  40. Spear, M.: Lightweight, Robust Adaptivity for Software Transactional Memory. In: Proceedings of the 22nd ACM Symposium on Parallelism in Algorithms and Architectures, Santorini, Greece (June 2010)

    Google Scholar 

  41. Spear, M., Dalessandro, L., Marathe, V.J., Scott, M.L.: A Comprehensive Strategy for Contention Management in Software Transactional Memory. In: Proceedings of the 14th ACM Symposium on Principles and Practice of Parallel Programming, Raleigh, NC (February 2009)

    Google Scholar 

  42. Spear, M., Marathe, V., Dalessandro, L., Scott, M.: Privatization Techniques for Software Transactional Memory (POSTER). In: Proceedings of the 26th ACM Symposium on Principles of Distributed Computing, Portland, OR (August 2007)

    Google Scholar 

  43. Spear, M., Michael, M.M., von Praun, C.: RingSTM: Scalable Transactions with a Single Atomic Instruction. In: Proceedings of the 20th ACM Symposium on Parallelism in Algorithms and Architectures, Munich, Germany (June 2008)

    Google Scholar 

  44. Spear, M., Silverman, M., Dalessandro, L., Michael, M.M., Scott, M.L.: Implementing and Exploiting Inevitability in Software Transactional Memory. In: Proceedings of the 37th International Conference on Parallel Processing, Portland, OR (September 2008)

    Google Scholar 

  45. Wang, C., Liu, Y., Spear, M.: Transaction-Friendly Condition Variables. In: Proceedings of the 26th ACM Symposium on Parallelism in Algorithms and Architectures, Prague, Czech Republic (June 2014)

    Google Scholar 

  46. Welc, A., Saha, B., Adl-Tabatabai, A.R.: Irrevocable Transactions and their Applications. In: Proceedings of the 20th ACM Symposium on Parallelism in Algorithms and Architectures, Munich, Germany (June 2008)

    Google Scholar 

  47. Yoo, R., Hughes, C., Lai, K., Rajwar, R.: Performance Evaluation of Intel Transactional Synchronization Extensions for High Performance Computing. In: Proceedings of the International Conference for High Performance Computing, Networking, Storage and Analysis, Denver, CO (November 2013)

    Google Scholar 

  48. Yoo, R., Lee, H.H.: Adaptive Transaction Scheduling for Transactional Memory Systems. In: Proceedings of the 20th ACM Symposium on Parallelism in Algorithms and Architectures, Munich, Germany (June 2008)

    Google Scholar 

  49. Yoo, R., Ni, Y., Welc, A., Saha, B., Adl-Tabatabai, A.R., Lee, H.H.: Kicking the Tires of Software Transactional Memory: Why the Going Gets Tough. In: Proceedings of the 20th ACM Symposium on Parallelism in Algorithms and Architectures, Munich, Germany (June 2008)

    Google Scholar 

  50. Zyulkyarov, F., Gajinov, V., Unsal, O., Cristal, A., Ayguade, E., Harris, T., Valero, M.: Atomic Quake: Using Transactional Memory in an Interactive Multiplayer Game Server. In: Proceedings of the 14th ACM Symposium on Principles and Practice of Parallel Programming, Raleigh, NC (February 2009)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2015 Springer International Publishing Switzerland

About this chapter

Cite this chapter

Spear, M., Ruan, W., Liu, Y., Vyas, T. (2015). Case Study: Using Transactions in Memcached. In: Guerraoui, R., Romano, P. (eds) Transactional Memory. Foundations, Algorithms, Tools, and Applications. Lecture Notes in Computer Science, vol 8913. Springer, Cham. https://doi.org/10.1007/978-3-319-14720-8_20

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-14720-8_20

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-14719-2

  • Online ISBN: 978-3-319-14720-8

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics