Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Concurrent Programming Demystified: The SystemJ Approach Partha S Roop Precision Timed Computing Group Department of Electrical and Computer Engineering 1 Presentation Outline Concurrency and reactivity Motivation for SystemJ SystemJ modeling from specification to implementation – a designer’s perspective Some implementation avenues. IDE and Testing Conclusions 2 Concurrency Embedded systems are highly concurrent. A game, for example, has many concurrent processes to capture the IO interaction and the modelling of actors. Concurrency is not well supported in conventional languages: Java concurrency is nondeterministic. RTOSs offer direct support for concurrent processes and the management of shared resources. However, they don’t guarantee determinism and also have implementation overheads. Question: can we provide a thread-safe model of concurrency while also providing efficient implementation avenues? 3 What is SystemJ A new programming language and associated tool-chain for programming highly concurrent and distributed systems. SystemJ is a language for programming Globally Asynchronous but Locally Synchronous (GALS) systems. Is based on Java that provides the OO encapsulation and abstraction. This is combined with synchronous concurrency of Esterel and asynchronous composition of CSP. Ideal for programming distributed systems such as smart camera, collaborative programming, medical electronics, robot programming environments, simulators, and computer games. 4 Clock Domains and Reactions 5 A simple synchronous program: The ABRO 6 ABRO in SystemJ 7 The Asynchronous ABRO 8 Sample Trace 9 A Protocol Stack in SystemJ 10 The Model in SystemJ Three Reactions in Synchronous Parallel Two CDs in Asynchronous Parallel 11 One Reaction in Detail Thread performing lengthy address computation Thread performing Coordination with the CRC checker 12 SystemJ Compilation Strategies TReK (True Reactive Kernel) – Java library; dynamic resolution of signal dependencies in CDs AGRC splits controldriven and data-driven operations with clear interface; static compiletime analysis of signal dependencies; sequentialized reactions in CD TReK AGRC Not full syntax Full syntax Missing preemptions All preemptions Library Formal Large memory footprint Smaller memory footprint Relies on Java threads No reliance on Java threads Control and data interleaved Separation of data and control 13 Compiling SystemJ – AGRC Approach SystemJ program represented by semantic preserving Asynchronous Graph Code (AGRC) AGRC splits controldriven and data-driven operations with clear interface Separates Java from control part 14 AGRC – Separation of Control and Data Compiler identifies the blocks of code that have to be executed on JVM If the target is JVM, then AGRC representation transformed into Java code – runs on JVM 15 New Compilation and Execution Strategies SystemJ SystemJ AGRC intermediate format AGRC intermediate format Control code for program flow and reactivity Java code for data operations Data calls JVM Returned results Queued data calls CVM JVM Returned results Tandem Virtual Machine (TVM) Control code for program flow and reactivity Java code for data operations Control Virtual Machine (CVM) is an interpreter of a special instruction set CP Tandem processor Control Processor (CP) is a real processor 16 Benchmarks 17 Benchmarks 18 Development Tools Eclipse based IDE Program editing functions GUI for debugger as a plug-in which extends debugger capability and highlights reactions Compiler – with selectable execution target Debugger For JVM implementations For TVM and HMP implementations 19 Development Environment SystemJ Source line EOT Output PC Registers Emitted Signals 20 Building Complex Software Systems SystemJ programs easily coexist each with the programs written in other languages. Condition: other programs “understand” the signal abstraction. Communication can be “direct” or through the operating system (using sockets as universal mechanism for external signals implementation). Execution platform is “hidden” by the operating system (can be single and/or multicore and/or br distributed). 21 Building Complex Software Systems PHYSICAL ENVIRONMENT Dedicated Drivers Signals Complex Software System Other programs SystemJ Program 1 Operating System SystemJ Program 2 Signals 22 Software Test-Bench 1 Environment emulator and observer of SystemJ design under test (DUT) may be added as another clock domain. Minor modification necessary in the DUT. SystemJ program/DUT Existing clock domain New reaction to communicate with test-bench Test-bench = SystemJ program = DUT + EE (CD) Testbench channels Environment emulator and observer (clock domain) 23 Software Test-Bench 2 Environment emulator and observer of SystemJ design under test (DUT) added as another SystemJ program No modification of DUT necessary DUT and Environment emulator (EE) can run on different processors/network Test-bench = DUT +EE They communicate through signals SystemJ program/DUT Operating System Environment emulator and observer (system) EE Test-bench signals 24 Building Distributed Systems Distributed systems can be composed without changing individual SystemJ programs NETWORK Computer 1 Computer N Core 1 Core 2 SystemJ Other programs Program Operating System SystemJ Program Operating System PHYSICAL ENVIRONMENT SystemJ Program 25 Qualitative comparison Axum (Microsoft) Concurrency Model Asynchronous Concurrency Synchronous Concurrency Guaranteed Determinancy Actors Yes No No Go (Google) Co(/Go)-routines Yes No No SystemJ (UoA) GALS Yes Yes Yes (Within a single CD) Communication Mechanisms Channels Channels Signals and Channels Pre-emption Support No No Yes Base Language(s) .NET Custom Java Size of Available Libraries Large (makes use of .NET libraries) Small Huge (can use any Java library) Supported Platforms Windows Linux, Mac OSX, Android Windows, Linux, Mac OSX, Android and Several Custom HW Platforms Compiles to CLR Bytecode Native machine code (x86/ARM) Java Source → Java Bytecode Conclusions SystemJ addresses needs of future embedded and distributed systems. System level approach to the design. GALS model of computation. Reuse of existing Java libraries. Range of target platforms. Flexibility – with or w/o OS. 27 Conclusions Tandem processor and GALS hybrid multiprocessor are platforms for constrained embedded applications. Compilation technology allows targeting any combination of JVM Data processors and Reactive Coprocessors. Performance improvement over pure JVM approaches. 28 SystemJ Publications F. Gruian, P. Roop, Z. Salcic, I. Radojevic, SystemJ Approach to system-level Design, Proceedings of Methods and Models for Co-Design Conference, Memocode 2006, Napa Valley California, 2006, pp. 149-58. Piscataway, NJ, USA A. Malik, Z. Salcic and P. S. Roop, Tandem Virtual Machine – An Efficient Execution Platform for GALS Language SystemJ, Asia-South Pacific Conference on Computer Architecture, 2008, p.1-8 A. Malik, Z. Salcic, A. Girault, A. Walker, S.L. Lee: A customizable multiprocessor for Globally Asynchronous Locally Synchronous execution, 7th International Workshop on Java Technologies for Real-Time and Embedded Systems, ACM Proceedings, Madrid, 23-25 September, 2009, p.120-129 A. Malik, Z. Salcic, P. Roop: SystemJ Compilation using the Tandem Virtual Machine Approach, ACM Transactions on Design Automation of Electronic Systems, 14, (3), p-, 2009 A. Malik, Z. Salcic, P. S. Roop and A. Girault. SystemJ: A GALS Language for System Level Design, Journal of Computer Languages, Systems & Structures, COMLAN, Elsevier, to appear, doi: 10.1016/j.cl.2010.01.001, 2010 Z. Salcic and A. Malik: SystemJ Technology – Programming Without Borders, White Paper, 2010, www.systemjtechnology.com 29 Acknowledgement of Contributions to SystemJ Technology Zoran Salcic Avinash Malik Partha Roop Flavius Gruian Luka Bartolec Robert Connolly Kyle Nicholas Ivan Radojevic Alain Girault Wei-Tsun Sun Elise Malard Sung Chul Lee Adam Walker 30 Thank you! 31 www.systemjtechnology.com e-mail: [email protected] 32