[go: up one dir, main page]
More Web Proxy on the site http://driver.im/ skip to main content
10.1145/1176617.1176758acmconferencesArticle/Chapter ViewAbstractPublication PagessplashConference Proceedingsconference-collections
Article

Hardware tansactional memory support for lightweight dynamic language evolution

Published: 22 October 2006 Publication History

Abstract

Lightweight dynamic language runtimes have become popular in part because they simply integrate with a wide range of native code libraries and embedding applications. However, further development of these runtimes in the areas of concurrency, efficiency and safety is impeded by the desire to maintain their native code interfaces, even at a source level. Native extension modules' lack of thread safety is a significant barrier to dynamic languages' effective deployment on current and future multicore and multiprocessor systems. We propose the use of hardware transactional memory (HTM) to aid runtimes in evolving more capable and robust execution models while maintaining native code compatibility. To explore these ideas, we constructed a full-system simulation infrastructure consisting of an HTM implementation, modified Linux kernel and Python interpreter.Python includes thread constructs, but its primary implementation is not architected to support their parallel execution. With small changes, a runtime can be made HTM-aware to enable parallel execution of Python code and extension modules. We exploit the semantics of Python execution to evaluate individual bytecodes atomically by default, using nested transactions to emulate programmer-specified locking constructs where possible in existing threaded code. We eliminate common transactional conflicts and defer I/O within transactions to make parallel Python execution both possible and efficient. Transactions also provide safety for foreign function invocations. We characterize several small Python applications executing on our infrastructure.

References

[1]
Concurrency in Python. In python-dev mailing list, September 2005. http://www.python.org/dev/summary/2005-09-16_2005-09-30.html#concurrency-in-python.]]
[2]
Erlang 5.5/OTP R11B highlights. http://www.erlang.org/doc/doc-5.5/doc/highlights.html.]]
[3]
A.-R. Adl-Tabatabai, B. T. Lewis, V. Menon, B. R. Murphy, B. Saha, and T. Shpeisman. Compiler and Runtime Support for Efficient Software Transactional Memory. In Proceedings of the SIGPLAN 2006 Conference on Programming Language Design and Implementation, June 2006.]]
[4]
C. S. Ananian, K. Asanović, B. C. Kuszmaul, C. E. Leiserson, and S. Lie. Unbounded Transactional Memory. In Proceedings of the Eleventh IEEE Symposium on High-Performance Computer Architecture, Feb. 2005.]]
[5]
A. Bergman. Where wizards fear to tread: Perl 5.8 threads. http://www.perl.com/pub/a/2002/06/11/threads.html.]]
[6]
C. Blundell, E. C. Lewis, and M. M. Martin. Deconstructing Transactional Semantics: The Subtleties of Atomicity. In Proceedings of the Fourth Workshop on Duplicating, Deconstructing, and Debunking, June 2005.]]
[7]
F. Drake, Jr. et al. Thread state and the Global Interpreter Lock. In Python C API Reference Manual. http: //docs.python.org/api/threads.html.]]
[8]
T. Harris, S. Marlowe, S. Peyton-Jones, and M. Herlihy. Composable Memory Transactions. In Principles and Practice of Parallel Programming (PPoPP), 2005.]]
[9]
T. Harris, M. Plesko, A. Shinnar, and D. Tarditi. Optimizing Memory Transactions. In Proceedings of the SIGPLAN 2006 Conference on Programming Language Design and Implementation, June 2006.]]
[10]
T. Heller. The ctypes module: an advanced foreign function interface for Python 2.3 and higher. http://starship.python.net/crew/theller/ctypes/.]]
[11]
M. Herlihy and J. E. B. Moss. Transactional Memory: Architectural Support for Lock-Free Data Structures. In Proceedings of the 20th Annual International Symposium on Computer Architecture, pages 289--300, May 1993.]]
[12]
M. Herlihy, V. Luchangco, M. Moir, and W. N. S. III. Software Transactional Memory for Dynamic-Sized Data Structures. In Proceedings of the Twenty-Second Symposium on Principles of Distributed Computing (PODC), 2003.]]
[13]
B. Hindman and D. Grossman. Strong Atomicity for Java Without Virtual-Machine Support. Technical Report UW-CSE 2006-05-01, May 2006.]]
[14]
T. Knight. An architecture for mostly functional languages. In Proceedings of the ACM Conference on LISP and Functional Programming, pages 105--112, 1986.]]
[15]
C. Lattner and V. Adve. LLVM: A compilation framework for lifelong program analysis and transformation. In Proc. Int'l Symp. on Code Generation and Optimization (CGO), San Jose, CA, March 2004.]]
[16]
G. Lefkowitz and I. Shtull-Trauring. Network programming for the rest of us. In USENIX Annual Technical Conference, FREENIX Track, pages 77--89. USENIX, 2003. ISBN 1-931971-11-0.]]
[17]
P. S. Magnussen et al. Simics: A full system simulation platform. IEEE COMPUTER, 35(2):50--58, February 2002.]]
[18]
K. E. Moore, J. Bobba, M. J. Moravan, M. D. Hill, and D. A. Wood. LogTM: Log-based Transactional Memory. In Proceedings of the Twelfth IEEE Symposium on High-Performance Computer Architecture, Feb. 2006.]]
[19]
J. Oplinger and M. S. Lam. Enhancing software reliability with speculative threads. In Proceedings of the Conference on Architectural Support for Programming Languages and Operating Systems, October 2002.]]
[20]
PyPy. An implementation of Python in Python. http://codespeak.net/pypy/.]]
[21]
R. Rajwar and J. R. Goodman. Speculative Lock Elision: Enabling Highly Concurrent Multithreaded Execution. In Proceedings of the 28th Annual International Symposium on Computer Architecture, July 2001.]]
[22]
R. Rajwar, M. Herlihy, and K. Lai. Virtualizing Transactional Memory. In Proceedings of the 32nd Annual International Symposium on Computer Architecture, June 2005.]]
[23]
A. Rigo. py.magic.greenlet: Lightweight concurrent programming. http://codespeak.net/py/current/doc/greenlet.html.]]
[24]
A. Rigo and S. Pedroni. PyPy's approach to virtual machine construction. In OOPSLA Dynamic Languages Symposium, Portland, Oregon, October 2006.]]
[25]
G. Stein. Population simulation in Stackless. In Stackless mailing list, August 2002. http://www.stackless.com/pipermail/stackless/2002-August/000482.html.]]
[26]
G. Stein. Python at Google. In PyCon, 2005. http://www.sauria.com/~twl/conferences/pycon2005/20050325/Python%20at%20Google.notes.]]
[27]
D. Sugalski and A. Bergman. perlthrtut - tutorial on threads in Perl. http://perldoc.perl.org/perlthrtut.html.]]
[28]
H. Sutter and J. Larus. Software and the Concurrency Revolution. ACM Queue, 3(7):54--62, Sept. 2005.]]
[29]
D. Thomas and A. Hunt. Threads and processes. In Programming Ruby: The Pragmatic Programmer's Guide. Addison Wesley Longman, 2001. http://www.rubycentral.com/book/tut_threads.html.]]
[30]
C. Tismer. Stackless Python: Tasklets. http://www.stackless.com/wiki/Tasklets.]]
[31]
C. Zilles and L. Baugh. Extending hardware transactional memory to support non-busy waiting and non-transactional actions. In TRANSACT: First ACM SIGPLAN Workshop on Languages, Compilers, and Hardware Support for Transactional Computing, Ottawa, Canada, June 2006.]]
[32]
C. Zilles and D. Flint. Challenges to Providing Performance Isolation in Transactional Memories. In Proceedings of the Fourth Workshop on Duplicating, Deconstructing, and Debunking, pages 48--55, June 2005.]]

Cited By

View all

Index Terms

  1. Hardware tansactional memory support for lightweight dynamic language evolution

    Recommendations

    Comments

    Please enable JavaScript to view thecomments powered by Disqus.

    Information & Contributors

    Information

    Published In

    cover image ACM Conferences
    OOPSLA '06: Companion to the 21st ACM SIGPLAN symposium on Object-oriented programming systems, languages, and applications
    October 2006
    530 pages
    ISBN:159593491X
    DOI:10.1145/1176617
    • General Chair:
    • Peri Tarr,
    • Program Chair:
    • William R. Cook
    Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

    Sponsors

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 22 October 2006

    Permissions

    Request permissions for this article.

    Check for updates

    Author Tags

    1. Python
    2. concurrency
    3. dynamic languages
    4. locking
    5. safety
    6. transactional memory

    Qualifiers

    • Article

    Conference

    OOPSLA06
    Sponsor:

    Upcoming Conference

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)2
    • Downloads (Last 6 weeks)0
    Reflects downloads up to 11 Jan 2025

    Other Metrics

    Citations

    Cited By

    View all

    View Options

    Login options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Media

    Figures

    Other

    Tables

    Share

    Share

    Share this Publication link

    Share on social media