The document discusses intermediate language design for virtual machines to provide comprehensive concurrency support. It surveys 17 existing virtual machines to evaluate their concurrency support and models. Only 6 provided explicit concurrency support in the intermediate language. Support ranged from low-level instructions to high-level constructs in standard libraries. To enable new concurrency concepts, future virtual machines need intermediate languages that support both low-level and high-level concurrency features, with an open question around the tradeoffs of features in the intermediate language versus the standard library.
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
Intermediate Language Design of High-level Language VMs: Towards Comprehensive Concurrency Support
1. Intermediate Language Designof High-level Language VMs Towards Comprehensive Concurrency Support Michael Haupt HassoPlattner Institute University of Potsdam Theo D’Hondt Software Languages Lab VrijeUniversiteitBrussel Stefan Marr Software Languages Lab VrijeUniversiteitBrussel VMIL Workshop, 25th October 2009, Orlando, Florida
2. Agenda Motivation Survey Design Concurrency Support Conclusion Outlook 10/27/09 2 IL Design For VMs, Stefan Marr, VMIL, Oct. 2009
3. Motivation VMs support concurrency insufficiently! Why? Because, we want multi-language VMs Fast JITs, great GCs How to design an intermediate language? To our knowledge No surveys No overview of design space/tradeoffs 10/27/09 3 IL Design For VMs, Stefan Marr, VMIL, Oct. 2009
4. Survey Design How to design an intermediate language? 10/27/09 IL Design For VMs, Stefan Marr, VMIL, Oct. 2009 4
5. Survey Design 10/27/09 5 IL Design For VMs, Stefan Marr, VMIL, Oct. 2009 Dis VM 4th ed. OTP R12 Dalvik VM 1.0 5.1 CLI/ECMA-355 1.3 JVM spec. 1.4 6.0 svn 2.6 Ruby 1.8/1.9 Rubinius V8 svn 4.4 Squeak 3.9 TraceMonkey All trademarks and logos are the property of their respective owners.
6. Survey Criteria Specification vs. implementation Abstraction level of intermediate language Machine model Representation, instruction encoding Instruction categories Arithmetic & logic, control flow, stack, … Optimizations 10/27/09 6 Survey Design
13. Concurrency support How to support concurrency in an intermediate language? 10/27/09 IL Design For VMs, Stefan Marr, VMIL, Oct. 2009 13
14.
15. 10/27/09 15 IL Design For VMs, Stefan Marr, VMIL, Oct. 2009 Why Concurrency in ILs?
16. Concurrency Support in the IL? 10/27/09 16 IL Design For VMs, Stefan Marr, VMIL, Oct. 2009 Dis VM 4th ed. OTP R12 Dalvik VM 1.0 5.1 CLI/ECMA-355 1.3 JVM spec. 1.4 6.0 svn 2.6 Ruby 1.8/1.9 Rubinius V8 svn 4.4 Squeak 3.9 TraceMonkey
17. Concurrency Support in the IL? 10/27/09 17 IL Design For VMs, Stefan Marr, VMIL, Oct. 2009 Dis VM 4th ed. OTP R12 Dalvik VM 1.0 5.1 CLI/ECMA-355 1.3 JVM spec. 1.4 6.0 svn 2.6 Ruby 1.8/1.9 Rubinius V8 svn 4.4 Squeak 3.9 TraceMonkey only 6 out of 17
18. Survey Criteria - Concurrency Concurrency support Concurrency model Included instructions Standard library (stdlib) 10/27/09 18 IL Design For VMs, Stefan Marr, VMIL, Oct. 2009
19. Common Language Infrastructure volatile.(prefix instruction) marks a subsequent pointer reference Synchronized methods Memory model Atomic read or write of certain aligned data Standard library Memory barriers, atomic updates Parallel loops, futures,… 10/27/09 19 Concurrency Support
20. Dis VM (spec. 4th ed.) Inspired by CommunicatingSequentialProcesses spawn – new thread new* – new channel recv, send – on given channel alt, nbalt – send or receive on ready channel Memory model unspecified 10/27/09 20 Concurrency Support
21. Erlang Actors model send, wait, wait_timeout remove_message timeout Pure, functional language No memory model specified Only high-level constructs in stdlib. 10/27/09 21 Concurrency Support
22. Java Virtual Machine monitorenter/-exit For synchronized blocks Synchronized methods Memory model Standard library Low- and high-level constructs DalvikVM promises the same 10/27/09 22 Concurrency Support
23. Mozart LOCKTHREAD No unlock Implicit support Data-flow variables, distribution Standard library High-level constructs Futures, stream channels,… 10/27/09 23 Concurrency Support
24. Conclusion Wide range of supported models No notion of multiple models Often limited to implicit semantics or guaranties Often most functionality in standard library 10/27/09 24 IL Design For VMs, Stefan Marr, VMIL, Oct. 2009
25. Outlook Multi-language VMs have to Enable language designer to invent new constructs/concepts Provide low- and high-level constructs Low-level: Memory barriers, atomic updates, … High-level: Tuplespaces, STM, Actors, … Open question: tradeoffs IL vs. stdlib. 10/27/09 25 IL Design For VMs, Stefan Marr, VMIL, Oct. 2009
The motivation for this survey is hopefully clear nowToday, I will present here only the survey designAnd the concurrency related features we found in the different VMs
Concurrency support for intermediate language
Let’s try to find an answer for this basic question
17 VMscommon open source VMsResearch VMsand production VMsOut of the Box: directly usable by the application developer which uses the target language running on top of the VM
CLI and JVM are only VMs here which are used as multi-langueVMs
DisVMOnly SpecificationMem-mem model
Virtual Machine Showdown: Stack Versus Registersby: Yunhe Shi and Kevin Casey and M. Anton Ertl and David GreggIn: ACM Trans. Archit. Code Optim. , Vol. 4 , Nr. 4New York, NY, USA: ACM (2008) , p. 1--36.
Another interesting approach
How to approach VM design when you want a JIT
Lets now focus on the concurrency support
VM support for concurrency as it is today is insufficientOur basic idea: Add support to the IL
But lets come back to our survey.So what is the state of the art to concurrency support in Ils?
17 VMscommon open source VMsResearch VMsand production VMsOut of the Box: directly usable by the application developer which uses the target language running on top of the VM
Basic Question for the Survey:How do VMs support concurrency models today?
Atomic: native word size 32/64bit, no update
Split up slide
I would like to discussion following thingsSuitability of chosen VMsValid reasons to chose JVM over something else? I.e. reasons to not use Lua?-Other platforms then TILE64 or CellBE, which might be interesting?Tradeoffs which should be investigatedThe final goal for my PhD is to cover the concurrency part of ISA/VM design as a cornerstone for multi-paradigm VMs