Pessimistic Software Lock-Elision

  • Yehuda Afek
  • Alexander Matveev
  • Nir Shavit
Part of the Lecture Notes in Computer Science book series (LNCS, volume 7611)


Read-write locks are one of the most prevalent lock forms in concurrent applications because they allow read accesses to locked code to proceed in parallel. However, they do not offer any parallelism between reads and writes.

This paper introduces pessimistic lock-elision (PLE), a new approach for non-speculatively replacing read-write locks with pessimistic (i.e. non-aborting) software transactional code that allows read-write concurrency even for contended code and even if the code includes system calls. On systems with hardware transactional support, PLE will allow failed transactions, or ones that contain system calls, to preserve read-write concurrency.

Our PLE algorithm is based on a novel encounter-order design of a fully pessimistic STM system that in a variety of benchmarks spanning from counters to trees, even when up to 40% of calls are mutating the locked structure, provides up to 5 times the performance of a state-of-the-art read-write lock.


Multicore Software Transactional memory Locks Lock-elision Wait-free 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Kapalka, M., Dragojevic, A., Guerraoui, R.: Stretching transactional memory. In: PLDI 2009: Proceedings of the 2009 ACM SIGPLAN Conference on Programming Language Design and Implementation, pp. 155–165. ACM, New York (2009)Google Scholar
  2. 2.
    Dice, D., Matveev, A., Shavit, N.: Implicit privatization using private transactions. In: Transact 2010, Paris, France (2010)Google Scholar
  3. 3.
    Shavit, N., Matveev, A.: Towards a fully pessimistic stm model. In: TRANSACT 2012 Workshop, New Orleans, LA, USA (2012)Google Scholar
  4. 4.
    Harris, T., Roy, A., Hand, S.: A runtime system for software lock elision. In: Proceedings of the 4th ACM European Conference on Computer Systems, EuroSys 2009, pp. 261–274. ACM, New York (2009)Google Scholar
  5. 5.
    Adl-Tabatabai, A., Welc, A., Saha, B.: Irrevocable transactions and their applications. In: SPAA 2008: Proceedings of the Twentieth Annual Symposium on Parallelism in Algorithms and Architectures, pp. 285–296. ACM, New York (2008)Google Scholar
  6. 6.
    Attiya, H., Hillel, E.: The Cost of Privatization. In: Lynch, N.A., Shvartsman, A.A. (eds.) DISC 2010. LNCS, vol. 6343, pp. 35–49. Springer, Heidelberg (2010)CrossRefGoogle Scholar
  7. 7.
    Keidar, I., Perelman, D., Fan, R.: On maintaining multiple versions in stm. In: Proceeding of the 29th ACM SIGACT-SIGOPS Symposium on Principles of Distributed computing, PODC 2010, pp. 16–25. ACM, New York (2010)Google Scholar
  8. 8.
    Desnoyers, M., Stern, A., McKenney, P., Walpole, J.: User-level implementations of read-copy update. IEEE Transactions on Parallel and Distributed Systems (2009)Google Scholar
  9. 9.
    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
  10. 10.
    Attiya, H., Hillel, E.: Single-Version STMs Can Be Multi-version Permissive (Extended Abstract). In: Aguilera, M.K., Yu, H., Vaidya, N.H., Srinivasan, V., Choudhury, R.R. (eds.) ICDCN 2011. LNCS, vol. 6522, pp. 83–94. Springer, Heidelberg (2011)CrossRefGoogle Scholar
  11. 11.
    Herlihy, M., Shavit, N.: The art of multiprocessor programming. Morgan Kaufmann (2008)Google Scholar
  12. 12.
    Intel. Intel architecture instruction set extensions programming reference – ch. 8. Document 319433-012A (2012)Google Scholar
  13. 13.
    Lev, Y., Luchangco, V., Marathe, V., Moir, M., Nussbaum, D., Olszewski, M.: Anatomy of a scalable software transactional memory. In: 4th ACM SIGPLAN Workshop on Transactional Computing, TRANSACT 2009 (2009)Google Scholar
  14. 14.
    Machens, H., Turau, V.: Avoiding Publication and Privatization Problems on Software Transactional Memory. In: Luttenberger, N., Peters, H. (eds.) 17th GI/ITG Conference on Communication in Distributed Systems (KiVS 2011), Dagstuhl, Germany. OpenAccess Series in Informatics (OASIcs), vol. 17, pp. 97–108. Schloss Dagstuhl–Leibniz-Zentrum fuer Informatik (2011)Google Scholar
  15. 15.
    Marathe, V., Spear, M., Scott, M.: Scalable techniques for transparent privatization in software transactional memory. In: International Conference on Parallel Processing, pp. 67–74 (2008)Google Scholar
  16. 16.
    Mellor-Crummey, J., Scott, M.: Algorithms for scalable synchronization on shared-memory multiprocessors. ACM Transactions on Computer Systems 9(1), 21–65 (1991)CrossRefGoogle Scholar
  17. 17.
    Fetzer, C., Felber, P., Riegel, T.: Dynamic performance tuning of word-based software transactional memory. In: PPoPP 2008: Proceedings of the 13th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, pp. 237–246. ACM, New York (2008)Google Scholar
  18. 18.
    Rajwar, R., Goodman, J.: Speculative lock elision: enabling highly concurrent multithreaded execution. In: MICRO, pp. 294–305. ACM/IEEE (2001)Google Scholar
  19. 19.
    Shpeisman, T., Menon, V., Adl-Tabatabai, A., Balensiefer, S., Grossman, D., Hudson, R., Moore, K., Saha, B.: Enforcing isolation and ordering in stm. SIGPLAN Not. 42, 78–88 (2007)CrossRefGoogle Scholar
  20. 20.
    Spear, M., Marathe, V., Dalessandro, L., Scott, M.: Privatization techniques for software transactional memory. In: Proceedings of the Twenty-Sixth Annual ACM Symposium on Principles of Distributed Computing, PODC 2007, pp. 338–339. ACM, New York (2007)CrossRefGoogle Scholar
  21. 21.
    Rajwar, R., Harris, T., Larus, J.: Transactional Memory, 2nd edn. Morgan and Claypool Publishers (2010)Google Scholar
  22. 22.
    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
  23. 23.

Copyright information

© Springer-Verlag Berlin Heidelberg 2012

Authors and Affiliations

  • Yehuda Afek
    • 1
  • Alexander Matveev
    • 1
  • Nir Shavit
    • 2
    • 1
  1. 1.Tel-Aviv UniversityIsrael
  2. 2.MITUSA

Personalised recommendations