Reusable Concurrent Data Types

  • Vincent Gramoli
  • Rachid Guerraoui
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 8586)


This paper contributes to address the fundamental challenge of building Concurrent Data Types (CDT) that are reusable and scalable at the same time. We do so by proposing the abstraction of Polymorphic Transactions (PT): a new programming abstraction that offers different compatible transactions that can run concurrently in the same application.

We outline the commonality of the problem in various object-oriented languages and implement PT and a reusable package in Java. With PT, annotating sequential ADTs guarantee novice programmers to obtain an atomic and deadlock-free CDT and let an advanced programmer leverage the application semantics to get higher performance.

We compare our polymorphic synchronization against transaction-based, lock-based and lock-free synchronizations on SPARC and x86-64 architectures and we integrate our methodology to a travel reservation benchmark. Although our reusable CDTs are sometimes less efficient than non-composable handcrafted CDTs from the JDK, they outperform all reusable Java CDTs.


Transactional Memory Size Method Software Transactional Memory Snapshot Isolation Concurrent Transaction 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Meyer, B.: Reusability: The case for object-oriented design. IEEE Software 4(2), 50–64 (1987)CrossRefGoogle Scholar
  2. 2.
    Herlihy, M., Wing, J.: Linearizability: a correctness condition for concurrent objects. ACM Trans. Program. Lang. Syst. 12(3), 463–492 (1990)CrossRefGoogle Scholar
  3. 3.
    Herlihy, M., Moss, J.E.B.: Transactional memory: architectural support for lock-free data structures. SIGARCH Comput. Archit. News 21(2), 289–300 (1993)CrossRefGoogle Scholar
  4. 4.
    Shavit, N., Touitou, D.: Software transactional memory. In: PODC, pp. 204–213 (1995)Google Scholar
  5. 5.
    Harris, T., Marlow, S., Peyton-Jones, S., Herlihy, M.: Composable memory transactions. In: PPoPP, pp. 48–60 (2005)Google Scholar
  6. 6.
    Wakita, K., Yonezawa, A.: Linguistic supports for development of distributed organizational information systems in object-oriented concurrent computation frameworks. SIGOIS Bull. 12, 185–198 (1991)CrossRefGoogle Scholar
  7. 7.
    Moss, J.E.B.: Open nested transactions: Semantics and support. In: Workshop on Memory Performance Issues (February 2006)Google Scholar
  8. 8.
    Herlihy, M., Koskinen, E.: Transactional boosting: A methodology for highly-concurrent transactional objects. In: PPoPP, pp. 207–216 (2008)Google Scholar
  9. 9.
    Felber, P., Gramoli, V., Guerraoui, R.: Elastic transactions. In: Keidar, I. (ed.) DISC 2009. LNCS, vol. 5805, pp. 93–107. Springer, Heidelberg (2009)CrossRefGoogle Scholar
  10. 10.
    Kulkarni, M., Nguyen, D., Prountzos, D., Sui, X., Pingali, K.: Exploiting the commutativity lattice. In: PLDI, pp. 542–555 (2011)Google Scholar
  11. 11.
    Gramoli, V., Guerraoui, R.: Democratizing transactional programming. In: Kon, F., Kermarrec, A.-M. (eds.) Middleware 2011. LNCS, vol. 7049, pp. 1–19. Springer, Heidelberg (2011)CrossRefGoogle Scholar
  12. 12.
    Turon, A.: Reagents: expressing and composing fine-grained concurrency. In: PLDI, pp. 157–168 (2012)Google Scholar
  13. 13.
    Minh, C.C., Chung, J., Kozyrakis, C., Olukotun, K.: Stamp: Stanford transactional applications for multi-processing. In: IISWC (2008)Google Scholar
  14. 14.
    Bayer, R., Schkolnick, M.: Concurrency of operations on b-trees. In: Readings in Database Systems, pp. 129–139 (1988)Google Scholar
  15. 15.
    Bernstein, P., Hadzilacos, V., Goodman, N.: Concurrency Control and Recovery in Database Systems. Addison-Wesley (1987)Google Scholar
  16. 16.
    Guerraoui, R., Kapalka, M.: On the correctness of transactional memory. In: PPoPP, pp. 175–184 (2008)Google Scholar
  17. 17.
    Welc, A., Saha, B., Adl-Tabatabai, A.R.: Irrevocable transactions and their applications. In: SPAA, pp. 285–296 (2008)Google Scholar
  18. 18.
    Korland, G., Shavit, N., Felber, P.: Deuce: Noninvasive software transactional memory. Transactions on HiPEAC 5(2) (2010)Google Scholar
  19. 19.
    Herlihy, M., Shavit, N.: The Art of Multiprocessor Programming. Morgan Kaufmann Publishers Inc., San Francisco (2008)Google Scholar
  20. 20.
    Michael, M.M., Scott, M.L.: Simple, fast, and practical non-blocking and blocking concurrent queue algorithms. In: PODC (1996)Google Scholar
  21. 21.
    Burnim, J., Necula, G., Sen, K.: Specifying and checking semantic atomicity for multithreaded programs. In: ASPLOS, pp. 79–90 (2011)Google Scholar
  22. 22.
    Matsuoka, S., Yonezawa, A.: Analysis of inheritance anomaly in object-oriented concurrent programming languages. In: Research Directions in Concurrent Object-Oriented Programming, pp. 107–150. MIT Press, Cambridge (1993)Google Scholar
  23. 23.
    Flanagan, C., Qadeer, S.: A type and effect system for atomicity. In: PLDI, pp. 338–349 (2003)Google Scholar
  24. 24.
    Wang, L., Stoller, S.D.: Runtime analysis of atomicity for multithreaded programs. IEEE Trans. Softw. Eng. 32(2), 93–110 (2006)CrossRefGoogle Scholar
  25. 25.
    Burckhardt, S., Alur, R., Martin, M.M.K.: Checkfence: checking consistency of concurrent data types on relaxed memory models. In: PLDI, pp. 12–21 (2007)Google Scholar
  26. 26.
    Flanagan, C., Freund, S.N., Lifshin, M., Qadeer, S.: Types for atomicity: Static checking and inference for Java. ACM Trans. Program. Lang. Syst. 30 (2008)Google Scholar
  27. 27.
    Lin, Y., Dig, D.: Check-then-act misuse of java concurrent collections. In: ICST, pp. 164–173 (2013)Google Scholar
  28. 28.
    Shacham, O., Bronson, N., Aiken, A., Sagiv, M., Vechev, M., Yahav, E.: Testing atomicity of composed concurrent operations. In: OOPSLA, pp. 51–64 (2011)Google Scholar
  29. 29.
    Felber, P., Fetzer, C., Marlier, P., Riegel, T.: Time-based software transactional memory. IEEE Trans. Parallel and Distributed Systems 21(12), 1793–1807 (2010)CrossRefGoogle Scholar
  30. 30.
    Scherer, I.W.N., Scott, M.L.: Advanced contention management for dynamic software transactional memory. In: PODC, pp. 240–248 (2005)Google Scholar
  31. 31.
    Riegel, T., Felber, P., Fetzer, C.: A lazy snapshot algorithm with eager validation. In: Dolev, S. (ed.) DISC 2006. LNCS, vol. 4167, pp. 284–298. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  32. 32.
    Cachopo, J.A., Rito-Silva, A.: Versioned boxes as the basis for memory transactions. Sci. Comput. Program. 63(2), 172–185 (2006)CrossRefzbMATHMathSciNetGoogle Scholar
  33. 33.
    Perelman, D., Fan, R., Keidar, I.: On maintaining multiple versions in STM. In: PODC, pp. 16–25 (2010)Google Scholar
  34. 34.
    Carlstrom, B.D., Chung, J., Chafi, H., McDonald, A., Cao Minh, C., Hammond, L., Kozyrakis, C., Olukotun, K.: Transactional execution of Java programs. In: SCOOL (2005)Google Scholar
  35. 35.
    Koskinen, E., Parkinson, M., Herlihy, M.: Coarse-grained transactions. In: POPL, pp. 19–30 (2010)Google Scholar
  36. 36.
    Hassan, A., Palmieri, R., Ravindran, B.: Optimistic transactional boosting. In: PPoPP, pp. 387–388 (2014)Google Scholar
  37. 37.
    Harmanci, D., Gramoli, V., Felber, P.: Atomic boxes: Coordinated exception handling with transactional memory. In: Mezini, M. (ed.) ECOOP 2011. LNCS, vol. 6813, pp. 634–657. Springer, Heidelberg (2011)CrossRefGoogle Scholar
  38. 38.
    Martin, M., Blundell, C., Lewis, E.: Subtleties of transactional memory atomicity semantics. IEEE Comput. Archit. Lett. 5 (2006)Google Scholar
  39. 39.
    Dice, D., Shalev, O., Shavit, N.N.: Transactional locking II. In: Dolev, S. (ed.) DISC 2006. LNCS, vol. 4167, pp. 194–208. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  40. 40.
    Dragojević, A., Guerraoui, R., Kapałka, M.: Stretching transactional memory. In: PLDI, pp. 155–165 (2009)Google Scholar
  41. 41.
    Dalessandro, L., Spear, M.F., Scott, M.L.: NOrec: streamlining STM by abolishing ownership records. In: PPoPP, pp. 67–78 (2010)Google Scholar
  42. 42.
    Bacon, D.F., Strom, R.E., Tarafdar, A.: Guava: a dialect of Java without data races. In: OOPSLA, pp. 382–400 (2000)Google Scholar
  43. 43.
    Meyer, B.: Systematic concurrent object-oriented programming. Commun. ACM 36(9), 56–80 (1993)CrossRefGoogle Scholar
  44. 44.
    Torshizi, F.A., Ostroff, J.S., Paige, R.F., Chechik, M.: The SCOOP concurrency model in Java-like languages. In: CPA, pp. 7–24 (2009)Google Scholar
  45. 45.
    West, S., Nanz, S., Meyer, B.: A modular scheme for deadlock prevention in an object-oriented programming model. In: Dong, J.S., Zhu, H. (eds.) ICFEM 2010. LNCS, vol. 6447, pp. 597–612. Springer, Heidelberg (2010)CrossRefGoogle Scholar
  46. 46.
    Gueta, G.G., Ramalingam, G., Sagiv, M., Yahav, E.: Concurrent libraries with foresight. In: PLDI, pp. 263–274 (2013)Google Scholar
  47. 47.
    Herlihy, M., Luchangco, V., Moir, M., Scherer, I.W.N.: Software transactional memory for dynamic-sized data structures. In: PODC, pp. 92–101 (2003)Google Scholar
  48. 48.
    Herlihy, M., Luchangco, V., Moir, M.: A flexible framework for implementing software transactional memory. In: OOPSLA, pp. 253–262 (2006)Google Scholar
  49. 49.
    Harris, T., Fraser, K.: Language support for lightweight transactions. In: OOPSLA, pp. 388–402 (2003)Google Scholar
  50. 50.
    Carlstrom, B.D., McDonald, A., Chafi, H., Chung, J., Minh, C.C., Kozyrakis, C., Olukotun, K.: The atomos transactional programming language. In: PLDI, pp. 1–13 (2006)Google Scholar
  51. 51.
    Carlstrom, B.D., McDonald, A., Carbin, M., Kozyrakis, C., Olukotun, K.: Transactional collection classes. In: PPoPP, pp. 56–67 (2007)Google Scholar
  52. 52.
    Kulkarni, M., Pingali, K., Walter, B., Ramanarayanan, G., Bala, K., Chew, L.P.: Optimistic parallelism requires abstractions. In: PLDI, pp. 211–222 (2007)Google Scholar
  53. 53.
    Tripp, O., Manevich, R., Field, J., Sagiv, M.: JANUS: exploiting parallelism via hindsight. In: PLDI, pp. 145–156 (2012)Google Scholar
  54. 54.
    Xiang, L., Scott, M.L.: Compiler aided manual speculation for high performance concurrent data structures. In: PPoPP, pp. 47–56 (2013)Google Scholar
  55. 55.
    Ni, Y., Menon, V., Abd-Tabatabai, A.R., Hosking, A.L., Hudson, R.L., Moss, J.E.B., Saha, B., Shpeisman, T.: Open nesting in software transactional memory. In: PPoPP, pp. 68–78 (2007)Google Scholar
  56. 56.
    Spear, M.F., Silverman, M., Dalessandro, L., Michael, M.M., Scott, M.L.: Implementing and exploiting inevitability in software transactional memory. In: ICPP, pp. 59–66 (2008)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2014

Authors and Affiliations

  • Vincent Gramoli
    • 1
  • Rachid Guerraoui
    • 2
  1. 1.NICTA and University of SydneyAustralia
  2. 2.EPFLSwitzerland

Personalised recommendations