Skip to main content
Log in

Window-based greedy contention management for transactional memory: theory and practice

  • Published:
Distributed Computing Aims and scope Submit manuscript

Abstract

We consider greedy contention managers for transactional memory for M × N execution windows of transactions with M threads and N transactions per thread. We present, formally analyze, and experimentally evaluate three new randomized greedy contention management algorithms for transaction windows. Assuming that each transaction has duration τ and conflicts with at most C other transactions inside the window, the first algorithm Offline-Greedy produces a schedule of length O(τ· (C + N· log(MN))) with high probability. The offline algorithm depends on knowing the conflict graph which evolves while the execution of the transactions progresses. The second algorithm Online-Greedy produces a schedule of length that is only a logarithmic factor worse than Offline-Greedy, but does not require knowledge of the conflict graph. The third algorithm Adaptive-Greedy is the adaptive version of the previous algorithms which produces a schedule of length asymptotically the same as with online algorithm by adaptively guessing the value of C. All of the algorithms exhibit competitive ratio very close to O(s), where s is the number of shared resources, and at the same time, our algorithms provide new non-trivial tradeoffs for greedy transaction scheduling that parameterize window sizes and transaction conflicts within the execution window. We evaluate these window-based algorithms experimentally using the sorted link list, red-black tree, skip list, and vacation benchmarks. The evaluation results confirm their benefits in practical performance throughput and other metrics such as aborts per commit ratio and execution time overhead, along with the non-trivial provable properties of the algorithms.

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

Access this article

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

Instant access to the full article PDF.

Institutional subscriptions

Similar content being viewed by others

References

  1. Ansari, M., Kotselidis, C., Lujan, M., Kirkham, C., Watson, I.: On the performance of contention managers for complex transactional memory benchmarks. In: Proceedings of the 8th International Symposium on Parallel and Distributed Computing (ISPDC), pp. 83–90 (2009)

  2. Ansari M., Luján M., Kotselidis C., Jarvis K., Kirkham C., Watson I.: Steal-on-abort: Improving transactional memory performance through dynamic transaction reordering. In: Seznec, A., Emer, J., O’Boyle, M., Martonosi, M., Ungerer, T. (eds) High Performance Embedded Architectures and Compilers, Lecture Notes in Computer Science, vol. 5409, pp. 4–18. Springer, Berlin, Heidelberg (2009)

    Chapter  Google Scholar 

  3. Attiya H., Epstein L., Shachnai H., Tamir T.: Transactional contention management asé1aé1non-clairvoyant scheduling problem. Algorithmica 57(1), 44–61 (2010)

    Article  MathSciNet  MATH  Google Scholar 

  4. Attiya H., Milani A.: Transactional scheduling for read-dominated workloads. In: Abdelzaher, T., Raynal, M., Santoro, N. (eds) Principles of Distributed Systems, Lecture Notes in Computer Science, vol. 5923, pp. 3–17. Springer, Berlin, Heidelberg (2009)

    Google Scholar 

  5. Awerbuch, B., Saks, M.: A dining philosophers algorithm with polynomial response time. In: Proceedings of the 31st Annual Symposium on Foundations of Computer Science (FOCS), vol. 1, pp. 65–74. IEEE Computer Society, Washington, DC, USA (1990)

  6. Baker B.S., Coffman E.G. Jr: Mutual exclusion scheduling. Theor. Comput. Sci. 162(2), 225–243 (1996)

    Article  MathSciNet  MATH  Google Scholar 

  7. Bodlaender H.L., Jansen K.: Restrictions of graph partition problems, part I. Theor. Comput. Sci. 148(1), 93–109 (1995)

    Article  MathSciNet  MATH  Google Scholar 

  8. Cao Minh, C., Chung, J., Kozyrakis, C., Olukotun, K.: STAMP: Stanford transactional applications for multi-processing. In: Proceedings of The IEEE International Symposium on Workload Characterization (IISWC), pp. 35–46 (2008)

  9. Damron, P., Fedorova, A., Lev, Y., Luchangco, V., Moir, M., Nussbaum, D.: Hybrid transactional memory. In: Proceedings of the 12th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS-XII), pp. 336–346. ACM, New York, NY, USA (2006)

  10. Dice D., Shalev O., Shavit N.: Transactional locking II. In: Dolev, S. (ed) Distributed Computing, Lecture Notes in Computer Science, vol. 4167, pp. 194–208. Springer, Berlin, Heidelberg (2006)

    Google Scholar 

  11. Dolev, S., Hendler, D., Suissa, A.: CAR-STM: scheduling-based collision avoidance and resolution for software transactional memory. In: Proceedings of the 27th Annual ACM symposium on Principles of Distributed Computing (PODC), pp. 125–134 (2008)

  12. Dragojević, A., Guerraoui, R., Singh, A.V., Singh, V.: Preventing versus curing: avoiding conflicts in transactional memories. In: Proceedings of the 28th Annual ACM Symposium on Principles of Distributed Computing (PODC), pp. 7–16 (2009)

  13. Even G., Halldórsson M.M., Kaplan L., Ron D.: Scheduling with conflicts: online and offline algorithms. J. Sched. 12(2), 199–224 (2009)

    Article  MathSciNet  MATH  Google Scholar 

  14. Felber, P., Fetzer, C., Riegel, T.: Dynamic performance tuning of word-based software transactional memory. In: Proceedings of the 13th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming (PPoPP), pp. 237–246 (2008)

  15. Garey M.R., Grahams R.L.: Bounds for multiprocessor scheduling with resource constraints. SIAM J. Comput. 4(2), 187–200 (1975)

    Article  MathSciNet  MATH  Google Scholar 

  16. Guerraoui, R., Herlihy, M., Kapalka, M., Pochon, B.: Robust contention management in software transactional memory. In: Proceedings of the OOPSLA 2005 Workshop on Synchronization and Concurrency on Object-Oriented Languages (SCOOL) (2005)

  17. Guerraoui R., Herlihy M., Pochon B.: Polymorphic contention management. In: Fraigniaud, P. (ed) Distributed Computing, Lecture Notes in Computer Science, vol. 3724, pp. 303–323. Springer, Berlin, Heidelberg (2005)

    Google Scholar 

  18. Guerraoui, R., Herlihy, M., Pochon, B.: Toward a theory of transactional contention managers. In: Proceedings of the 24th Annual ACM Symposium on Principles of Distributed Computing (PODC), pp. 258–264 (2005)

  19. Guerraoui R., Kapalka M., Vitek J.: Stmbench7: a benchmark for software transactional memory. SIGOPS Oper. Syst. Rev. 41(3), 315–324 (2007)

    Article  Google Scholar 

  20. Halldórsson M.M., Kortsarz G., Proskurowski A., Salman R., Shachnai H., Telle J.A.: Multicoloring trees. Inf. Comput. 180(2), 113–129 (2003)

    Article  MATH  Google Scholar 

  21. Hammond L., Carlstrom B.D., Wong V., Chen M., Kozyraki C., Olukotun K.: Transactional coherence and consistency: simplifying parallel hardware and software. IEEE Micro 24(6), 92–103 (2004)

    Article  Google Scholar 

  22. Harris T., Fraser K.: Language support for lightweight transactions. SIGPLAN Notices 38(11), 388–402 (2003)

    Article  Google Scholar 

  23. Harris, T., Marlow, S., Peyton-Jones, S., Herlihy, M.: Composable memory transactions. In: Proceedings of the 10th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming (PPoPP), pp. 48–60 (2005)

  24. Hasenfratz, D., Schneider, J., Wattenhofer, R.: Transactional memory: how to perform load adaption in a simple and distributed manner. In: Proceedings of the 2010 International Conference on High Performance Computing and Simulation (HPCS), pp. 163–170 (2010)

  25. Herlihy, M., Luchangco, V., Moir, M.: Obstruction-free synchronization: double-ended queues as an example. In: Proceedings of the 23th International Conference on Distributed Computing Systems (ICDCS), pp. 522–529 (2003)

  26. Herlihy M., Luchangco V., Moir M.: A flexible framework for implementing software transactional memory. SIGPLAN Notices 41(10), 253–262 (2006)

    Article  Google Scholar 

  27. Herlihy, M., Luchangco, V., Moir, M., Scherer III, W.N.: Software transactional memory for dynamic-sized data structures. In: Proceedings of the 22th Annual ACM Symposium on Principles of Distributed Computing (PODC), pp. 92–101 (2003)

  28. Herlihy, M., Moss, J.E.B.: Transactional memory: architectural support for lock-free data structures. In: Proceedings of the 20th Annual International Symposium on Computer Architecture (ISCA), pp. 289–300 (1993)

  29. Irani, S., Leung, V.: Scheduling with conflicts, and applications to traffic signal control. In: Proceedings of the Seventh Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pp. 85–94. Society for Industrial and Applied Mathematics, Philadelphia, PA, USA (1996)

  30. Khot, S.: Improved inapproximability results for maxclique, chromatic number and approximate graph coloring. In: Proceedings of the 42th IEEE Symposium on Foundations of Computer Science (FOCS), pp. 600–609 (2001)

  31. Luby M.: A simple parallel algorithm for the maximal independent set problem. SIAM J. Comput. 15(4), 1036–1055 (1986)

    Article  MathSciNet  MATH  Google Scholar 

  32. Marathe, V.J., Spear, M.F., Heriot, C., Acharya, A., Eisenstat, D., Scherer, W.N. III, Scott, M.L.: Lowering the overhead of software transactional memory. Tech. Rep. TR 893, Computer Science Department, University of Rochester (2006)

  33. Minh, C.C., Trautmann, M., Chung, J., McDonald, A., Bronson, N., Casper, J., Kozyrakis, C., Olukotun, K.: An effective hybrid transactional memory system with strong isolation guarantees. In: Proceedings of the 34th Annual International Symposium on Computer Architecture (ISCA), pp. 69–80. ACM, New York, NY, USA (2007)

  34. Motwani R., Phillips S., Torng E.: Non-clairvoyant scheduling. Theor. Comput. Sci. 130(1), 17–47 (1994)

    Article  MathSciNet  MATH  Google Scholar 

  35. Pugh W.: Skip lists: a probabilistic alternative to balanced trees. Commun. ACM 33(6), 668–676 (1990)

    Article  MathSciNet  Google Scholar 

  36. Rajwar, R., Goodman, J.R.: Transactional lock-free execution of lock-based programs. In: Proceedings of the 10th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS-X), pp. 5–17. ACM (2002)

  37. Ramadan H.E., Rossbach C.J., Porter D.E., Hofmann O.S., Bhandari A., Witchel E.: Metatm/txlinux: Transactional memory for an operating system. IEEE Micro 28(1), 42–51 (2008)

    Article  Google Scholar 

  38. Scherer, W.N. III, Scott, M.L.: Advanced contention management for dynamic software transactional memory. In: Proceedings of the 24th Annual ACM Symposium on Principles of Distributed Computing (PODC), pp. 240–248 (2005)

  39. Scherer, W.N. III, Scott, M.L.: Contention management in dynamic software transactional memory. In: Proceedings of the ACM PODC Workshop on Concurrency and Synchronization in Java Programs (CSJP). St. John’s, NL, Canada (2004)

  40. Schneider J., Wattenhofer R.: Bounds on contention management algorithms. Theor. Comput. Sci. 412(32), 4151–4160 (2011)

    Article  MathSciNet  MATH  Google Scholar 

  41. Sharma, G., Busch, C.: A competitive analysis for balanced transactional memory workloads. Algorithmica, Online First pp. 1–27, (A preliminary version In: Proceedings of the 14th International Conference on Principles of Distributed Systems (OPODIS 2010), Lecture Notes in Computer Science, vol. 6490, pp. 348–363). Springer Berlin, Heidelberg (2011)

  42. Sharma, G., Busch, C.: On the performance of window-based contention managers for transactional memory. International Symposium on Parallel and Distributed Processing Workshops and PhD Forum (IPDPSW) pp. 559–568 (2011)

  43. Sharma G., Estrade B., Busch C.: Window-based greedy contention management for transactional memory. In: Lynch, N., Shvartsman, A. (eds) Distributed Computing, Lecture Notes in Computer Science, vol. 6343, pp. 64–78. Springer, Berlin, Heidelberg (2010)

    Google Scholar 

  44. Shavit N., Touitou D.: Software transactional memory. Distrib. Comput. 10(2), 99–116 (1997)

    Article  Google Scholar 

  45. Stone J.M., Stone H.S., Heidelberger P., Turek J.: Multiple reservations and the oklahoma update. IEEE Parallel Distrib. Technol. 1(4), 58–71 (1993)

    Article  Google Scholar 

  46. Yoo, R.M., Lee, H.H.S.: Adaptive transaction scheduling for transactional memory systems. In: Proceedings of the 20th Annual Symposium on Parallelism in Algorithms and Architectures (SPAA), pp. 169–178 (2008)

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Gokarna Sharma.

Additional information

This paper combines and extends preliminary results that appeared in [42,43].

Rights and permissions

Reprints and permissions

About this article

Cite this article

Sharma, G., Busch, C. Window-based greedy contention management for transactional memory: theory and practice. Distrib. Comput. 25, 225–248 (2012). https://doi.org/10.1007/s00446-012-0159-7

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00446-012-0159-7

Keywords

Navigation