skip to main content
research-article

Eliminating global interpreter locks in ruby through hardware transactional memory

Published:06 February 2014Publication History
Skip Abstract Section

Abstract

Many scripting languages use a Global Interpreter Lock (GIL) to simplify the internal designs of their interpreters, but this kind of lock severely lowers the multi-thread per-formance on multi-core machines. This paper presents our first results eliminating the GIL in Ruby using Hardware Transactional Memory (HTM) in the IBM zEnterprise EC12 and Intel 4th Generation Core processors. Though prior prototypes replaced a GIL with HTM, we tested real-istic programs, the Ruby NAS Parallel Benchmarks (NPB), the WEBrick HTTP server, and Ruby on Rails. We devised a new technique to dynamically adjust the transaction lengths on a per-bytecode basis, so that we can optimize the likelihood of transaction aborts against the relative overhead of the instructions to begin and end the transactions. Our results show that HTM achieved 1.9- to 4.4-fold speedups in the NPB programs over the GIL with 12 threads, and 1.6- and 1.2-fold speedups in WEBrick and Ruby on Rails, respectively. The dynamic transaction-length adjustment chose the best transaction lengths for any number of threads and applications with sufficiently long running times.

References

  1. Blundell, C., Raghavan, A., and Martin, M. M. K. RETCON: transactional repair without replay. In ISCA, pp. 258--269, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Cascaval, C., Blundell, C., Michael, M., Cain, H. W., Wu, P., Chiras, S., and Chatterjee, S. Software transactional memory: why is it only a research toy? ACM Queue, 6(5), pp. 46--58, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Dice, D., Lev, Y., Moir, M., and Nussbaum, D. Early experience with a commercial hardware transactional memory implementation. In ASPLOS, pp. 157--168, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. ECMAScript. http://www.ecmascript.org/.Google ScholarGoogle Scholar
  5. Haring, R. A., Ohmacht, M., Fox, T. W., Gschwind, M. K., Satterfield, D. L., Sugavanam, K., Coteus, P. W., Heidelberger, P., Blumrich, M. A., Wisniewski, R.W., Gara, A., Chiu, G. L.-T., Boyle, P.A., Chist, N.H., and Kim, C. The IBM Blue Gene/Q compute chip. IEEE Micro, 32(2), pp. 48--60, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. IBM. Power ISA Transactional Memory. Power.org, 2012.Google ScholarGoogle Scholar
  7. IBM. z/Architecture Principles of Operation Tenth Edition (September, 2012). http://publibfi.boulder.ibm.com/epubs/pdf/dz9zr009.pdf.Google ScholarGoogle Scholar
  8. Intel Corporation. Intel Architecture Instruction Set Extensions Programming Reference. 319433-012a edition, 2012.Google ScholarGoogle Scholar
  9. IronPython, http://ironpython.codeplex.com/.Google ScholarGoogle Scholar
  10. IronRuby, http://www.ironruby.net/.Google ScholarGoogle Scholar
  11. Jacobi, C., Slegel, T., and Greinder, D. Transactional memory architecture and implementation for IBM System z. In MICRO 45, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. JRuby, http://jruby.org/.Google ScholarGoogle Scholar
  13. Jython, http://www.jython.org/.Google ScholarGoogle Scholar
  14. Lua, http://www.lua.org/Google ScholarGoogle Scholar
  15. Minh, C. C., Chung, J., Kozyrakis, C., and Olukotun, K. STAMP: Stanford transactional applications for multi-processing. In IISWC, pp. 35--46, 2008.Google ScholarGoogle Scholar
  16. NAS Parallel Benchmarks, http://www.nas.nasa.gov/publications/npb.html.Google ScholarGoogle Scholar
  17. Nose, T. Ruby version of NAS Parallel Benchmarks 3.0. http://www-hiraki.is.s.u-tokyo.ac.jp/members/tknose/.Google ScholarGoogle Scholar
  18. Odaira, R. and Castanos, J. G. Eliminating global interpreter locks in Ruby through hardware transactional memory. Research Report RT0950, IBM Research -- Tokyo, 2013.Google ScholarGoogle Scholar
  19. Perl threads, http://perldoc.perl.org/perlthrtut.html.Google ScholarGoogle Scholar
  20. PyPy Status Blog. We need Software Transactional Memory. http://morepypy.blogspot.jp/2011/08/we-need-software-transactional-memory.html.Google ScholarGoogle Scholar
  21. Python programming language. http://www.python.org/.Google ScholarGoogle Scholar
  22. Rajwar, R. and Goodman, J. R. Speculative lock elision: enabling highly concurrent multithreaded execution. In MICRO, pp. 294--305, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Riley, N. and Zilles, C. Hardware transactional memory support for lightweight dynamic language evolution. In Dynamic Language Symposium (OOPSLA Companion), pp. 998--1008, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Rubinius, http://rubini.us/.Google ScholarGoogle Scholar
  25. Ruby on Rails. http://rubyonrails.org/.Google ScholarGoogle Scholar
  26. Ruby programming language, http://www.ruby-lang.org/.Google ScholarGoogle Scholar
  27. Shum, C.-L. IBM zNext: the 3rd generation high frequency micro-processor chip. In HotChips 24, 2012.Google ScholarGoogle Scholar
  28. Stuecheli, J. Next Generation POWER microprocessor. In HotChips 25, 2013.Google ScholarGoogle Scholar
  29. Tabba, F. Adding concurrency in python using a commercial processor's hardware transactional memory support. ACM SIGARCH Computer Architecture News, 38(5), pp. 12--19, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Tatsubori, M., Tozawa, A., Suzumura, T., Trent, S., Onodera, T. Evaluation of a just-in-time compiler retrofitted for PHP. In VEE, pp. 121--132, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Wang, A., Gaudet, M., Wu, P., Ohmacht, M., Amaral, J. N., Barton, C., Silvera, R., Michael, M. M. Evaluation of Blue Gene/Q hardware support for transactional memories. In PACT, pp. 127--136, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Eliminating global interpreter locks in ruby through hardware transactional memory

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in

      Full Access

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader
      About Cookies On This Site

      We use cookies to ensure that we give you the best experience on our website.

      Learn more

      Got it!