Process Mobility on the JVM for ProcessJ

Slides:



Advertisements
Similar presentations
CPSC 388 – Compiler Design and Construction
Advertisements

Synopsys University Courseware Copyright © 2012 Synopsys, Inc. All rights reserved. Compiler Optimization and Code Generation Lecture - 3 Developed By:
Intermediate Code Generation
The University of Adelaide, School of Computer Science
Introduction to Assembly language
Programming Languages and Paradigms
Adapted from Scott, Chapter 6:: Control Flow Programming Language Pragmatics Michael L. Scott.
Homework Any Questions?. Statements / Blocks, Section 3.1 An expression becomes a statement when it is followed by a semicolon x = 0; Braces are used.
1 Tuesday, November 07, 2006 “If anything can go wrong, it will.” -Murphy’s Law.
Using a CSP based Programming Model for Reconfigurable Processor Arrays By: Zain-ul-Abdin
Portable Support for Transparent Thread Migration in Java Eddy Truyen, Bert Robben, Bart Vanhaute, Tim Coninx, Wouter Jousen and Pierre Verbaeten Department.
Outline Java program structure Basic program elements
1. 2 FUNCTION INLINE FUNCTION DIFFERENCE BETWEEN FUNCTION AND INLINE FUNCTION CONCLUSION 3.
Inline Function. 2 Expanded in a line when it is invoked Ie compiler replace the function call with function code To make a function inline the function.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Parallel & Concurrent Programming: Occam Vitaliy Lvin University of Massachusetts.
Imperative Programming
DAT602 Database Application Development Lecture 5 JAVA Review.
Java Language and SW Dev’t
1 CSC 201: Computer Programming I B. S. Afolabi. Introduction  3 unit course  2 hours of lecture/week Thursdays 4.00pm – 6.00pm Mondays 4.00pm – 6.00pm.
Advanced Programming Collage of Information Technology University of Palestine, Gaza Prepared by: Mahmoud Rafeek Alfarra Lecture 2: Major Concepts of Programming.
CSC204 – Programming I Lecture 4 August 28, 2002.
JAVA Tokens. Introduction A token is an individual element in a program. More than one token can appear in a single line separated by white spaces.
Chapter 8 High-Level Programming Languages. 8-2 Chapter Goals Describe the translation process and distinguish between assembly, compilation, interpretation,
5-1 Repetition Statements Repetition statements allow us to execute a statement multiple times Often they are referred to as loops Like conditional statements,
1 C# A brief overview by Jack Senechal and Bryan Powell.
 Pearson Education, Inc. All rights reserved Introduction to Java Applications.
Applications Development
A Quick Java Course part 1 Michael McDougall CIS 573 September 27 th, 1999.
By Mr. Muhammad Pervez Akhtar
 Control Flow statements ◦ Selection statements ◦ Iteration statements ◦ Jump statements.
Spring 2009 Programming Fundamentals I Java Programming XuanTung Hoang Lecture No. 8.
UMass Lowell Computer Science Java and Distributed Computing Prof. Karen Daniels Fall, 2000 Lecture 8 Java Fundamentals Control Structures Fri.
Chapter 1 Java Programming Review. Introduction Java is platform-independent, meaning that you can write a program once and run it anywhere. Java programs.
AP Java Ch. 4 Review Question 1  Java methods can return only primitive types (int, double, boolean, etc).
Chapter 7: Repetition Structure (Loop) Department of Computer Science Foundation Year Program Umm Alqura University, Makkah Computer Programming Skills.
Session 2 Operators, Decisions and Loops. Objectives Operators Casting data Decision marking structures Loops break, continue, return.
C syntax (simplified) BNF. Program ::= [ ] Directives ::= [ ] ::= | |… ::=#include > ::=#define.
Chapter 7 Control Structures. Java has very flexible three looping mechanisms. You can use one of the following three loops:  while Loop  do...while.
Features of JAVA PLATFORM INDEPENDENT LANGUAGE JAVA RUNTIME ENVIRONMENT (JRE) JAVA VIRTUAL MACHINE (JVM) JAVA APP BYTE CODE JAVA RUNTIME ENVIRONMENT.
ActionScript Programming Help
CIS 234: Object-Oriented Programming with Java
Code Optimization Code produced by compilation algorithms can often be improved (ideally optimized) in terms of run-time speed and the amount of memory.
Code Optimization Overview and Examples
Chapter 6: Loops.
Working with Java.
Before You Begin Nahla Abuel-ola /WIT.
Programmation impérative - Prof. Béat Hirsbrunner
Control Flow (Chapter 3)
Unit-1 Introduction to Java
Java Primer 1: Types, Classes and Operators
Overview of Compilation The Compiler BACK End
Lecture 14: Iteration and Recursion (Section 6.5 – 6.6)
Engineering Innovation Center
11/10/2018.
Chap. 6 :: Control Flow Michael L. Scott.
Statements, Comments & Simple Arithmetic
Loop Control Structure.
Starting JavaProgramming
Conditional Statements
Overview of Compilation The Compiler BACK End
Chap. 6 :: Control Flow Michael L. Scott.
CSC215 Lecture Flow Control.
CSC215 Lecture Control Flow.
Sridhar Narayan Java Basics Sridhar Narayan
Homework Any Questions?.
Java Review Most of these slides are based on
C Programming Getting started Variables Basic C operators Conditionals
Program Flow.
Chap 2. Identifiers, Keywords, and Types
CSC215 Lecture Control Flow.
Presentation transcript:

Process Mobility on the JVM for ProcessJ CPA 2009

Intro to ProcessJ ProcessJ is a new process-oriented language   Syntax close to Java and a semantics close to occam-π Scoping rules similar to Java Provides an approachable environment for broader audience of imperative programmers Multiple target platforms

Intro to ProcessJ Multiplexer Example (Occam) PROC mux (CHAN INT in1?, in2?, out!)   INT data: WHILE TRUE ALT     in1 ? data out ! data in2 ? data

Intro to ProcessJ Multiplexer Example proc void mux(chan<int>.read in1,               chan<int>.read in2,               chan<int>.write out) {     int data;     while (true) {         alt {             data = in1.read() :                 out.write(data);             data = in2.read() :         }     } }

Intro to ProcessJ Sequential subset mimics Java/C   Sequential subset mimics Java/C Semicolon delimited statements Assignment, arithmetic Conditionals For, While loops

Intro to ProcessJ Channels look like objects with read, write methods (as in JCSP) Special syntax for: Par blocks Alt bocks Parallel For loops

Our Compiler Multiple backends MPI, Java (JCSP), Occam Java backend targets Java source code Take advantage of javac's optimizer

JCSP / JCSP.net Serialization Network Classloading Mobile Channels, Processes

Process Mobility Illustrate process mobility in JCSP Peter Welch - Bond example (jcsp.net pg 88)

Process Mobility Certain behavior implied at suspend point mobile proc void foo() {     int a = 0;     while (a == 0) {         a = a + 1;         suspend;         a = a - 1;     } }

Challenges of the platform No continuations Limitations on flow control

Suspending Support must be added for saving and restoring the local variable part of the JVM activation record - Return control to caller  

Resuming Restore activation record Jump to appropriate bytecode instruction Goto would be nice!  

Code Outline public class Foo { private Object[] actRec; private int jumpTarget public void foo() { ... switch (jumpTarget) { case 1: goto #1; default: break; } while(1) { suspend(); ; #1 } } }

Source Code Rewriting Methods Must separate code into regions between suspend calls (Fuenfrocken 98) Java compiler sensitive to visibility of declared variables Large overhead in generated LOCs

Bytecode Transformation -Truyen -Bouchenak

Overview of transformation  

Bytecode Transformation