Portable Support for Transparent Thread Migration in Java Eddy Truyen, Bert Robben, Bart Vanhaute, Tim Coninx, Wouter Jousen and Pierre Verbaeten Department.

Slides:



Advertisements
Similar presentations
Chapter 16 Java Virtual Machine. To compile a java program in Simple.java, enter javac Simple.java javac outputs Simple.class, a file that contains bytecode.
Advertisements

R4 Dynamically loading processes. Overview R4 is closely related to R3, much of what you have written for R3 applies to R4 In R3, we executed procedures.
1 Lecture 4: Procedure Calls Today’s topics:  Procedure calls  Large constants  The compilation process Reminder: Assignment 1 is due on Thursday.
Functions Functions and Parameters. History A function call needs to save the registers in use The called function will use the registers The registers.
1 InTroToJCL Introduction to Java Class Loaders. 2 class loader l ia an object responsible for loading classes. The class ClassLoader is an abstract class.
Java Virtual Machine (JVM). Lecture Objectives Learn about the Java Virtual Machine (JVM) Understand the functionalities of the class loader subsystem.
1 1 Lecture 14 Java Virtual Machine Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung Institute of Technology.
Prof. Necula CS 164 Lecture 141 Run-time Environments Lecture 8.
JAVA Processors and JIT Scheduling. Overview & Literature n Formulation of the problem n JAVA introduction n Description of Caffeine * Literature: “Java.
The road to reliable, autonomous distributed systems
Chapter 9 Subprogram Control Consider program as a tree- –Each parent calls (transfers control to) child –Parent resumes when child completes –Copy rule.
1 Storage Registers vs. memory Access to registers is much faster than access to memory Goal: store as much data as possible in registers Limitations/considerations:
Remote Method Invocation Chin-Chih Chang. Java Remote Object Invocation In Java, the object is serialized before being passed as a parameter to an RMI.
1 Handling nested procedures Method 1 : static (access) links –Reference to the frame of the lexically enclosing procedure –Static chains of such links.
CS 536 Spring Run-time organization Lecture 19.
3/17/2008Prof. Hilfinger CS 164 Lecture 231 Run-time organization Lecture 23.
Exceptions in Java Fawzi Emad Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Programming Language Semantics Java Threads and Locks Informal Introduction The Java Specification Language Chapter 17.
JVM-1 Introduction to Java Virtual Machine. JVM-2 Outline Java Language, Java Virtual Machine and Java Platform Organization of Java Virtual Machine Garbage.
Chapter 16 Java Virtual Machine. To compile a java program in Simple.java, enter javac Simple.java javac outputs Simple.class, a file that contains bytecode.
Run-time Environment and Program Organization
1 A Portable Mechanism for Thread Persistence and Migration Wei Tao The School of Computing University of Utah Doctoral Dissertation Defense January 3,
Processes CS 416: Operating Systems Design, Spring 2001 Department of Computer Science Rutgers University
Session-02. Objective In this session you will learn : What is Class Loader ? What is Byte Code Verifier? JIT & JAVA API Features of Java Java Environment.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Java Software Solutions Foundations of Program Design Sixth Edition by Lewis.
Java Security Updated May Topics Intro to the Java Sandbox Language Level Security Run Time Security Evolution of Security Sandbox Models The Security.
Chapter 51 Threads Chapter 5. 2 Process Characteristics  Concept of Process has two facets.  A Process is: A Unit of resource ownership:  a virtual.
Introduction to Java CSIS 3701: Advanced Object Oriented Programming.
Previous Next 06/18/2000Shanghai Jiaotong Univ. Computer Science & Engineering Dept. C+J Software Architecture Shanghai Jiaotong University Author: Lu,
1 Java Programming II Java Network II (Distributed Objects in Java)
Paradyn Project Dyninst/MRNet Users’ Meeting Madison, Wisconsin August 7, 2014 The Evolution of Dyninst in Support of Cyber Security Emily Gember-Jacobson.
Programmer's view on Computer Architecture by Istvan Haller.
Lecture 10 : Introduction to Java Virtual Machine
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Threads and Processes.
Runtime Environments Compiler Construction Chapter 7.
1 Module Objective & Outline Module Objective: After completing this Module, you will be able to, appreciate java as a programming language, write java.
1 Comp 104: Operating Systems Concepts Java Development and Run-Time Store Organisation.
1 Introduction to JVM Based on material produced by Bill Venners.
G-JavaMPI: A Grid Middleware for Distributed Java Computing with MPI Binding and Process Migration Supports Lin Chen, Cho-Li Wang, Francis C. M. Lau and.
Java 2 security model Valentina Casola. Components of Java the development environment –development lifecycle –Java language features –class files and.
Netprog: Java Intro1 Crash Course in Java. Netprog: Java Intro2 Why Java? Network Programming in Java is very different than in C/C++ –much more language.
Hardware process When the computer is powered up, it begins to execute fetch-execute cycle for the program that is stored in memory at the boot strap entry.
1 Introduction to Java. 2 What is Java? A programming language. A platform –A virtual machine (JVM) definition. –Runtime environments in diverse hardware.
COP4020 Programming Languages Subroutines and Parameter Passing Prof. Xin Yuan.
Java Security Model For Mobile Code Abdo Achkar. Mobile Code A mobile object is a “self contained piece” of executable code. Definition:  Code that can.
Exception Compiler Baojian Hua
Processes CS 6560: Operating Systems Design. 2 Von Neuman Model Both text (program) and data reside in memory Execution cycle Fetch instruction Decode.
Java Thread and Memory Model
 In the java programming language, a keyword is one of 50 reserved words which have a predefined meaning in the language; because of this,
Programming Languages and Paradigms Activation Records in Java.
Quick Review of OOP Constructs Classes:  Data types for structured data and behavior  fields and methods Objects:  Variables whose data type is a class.
UNDER THE HOOD: THE JAVA VIRTUAL MACHINE II CS2110 Fall 200 Lecture 25 1.
RealTimeSystems Lab Jong-Koo, Lim
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
A Single Intermediate Language That Supports Multiple Implemtntation of Exceptions Delvin Defoe Washington University in Saint Louis Department of Computer.
16 Exception Handling.
Introduction to Kernel
Java Programming Language
The University of Adelaide, School of Computer Science
Run-time organization
Introduction Enosis Learning.
Process Mobility on the JVM for ProcessJ
Introduction Enosis Learning.
null, true, and false are also reserved.
Ashish Malgi, Neelesh Bansod, Byung K. Choi
Units with – James tedder
Units with – James tedder
CS510 Operating System Foundations
M S COLLEGE ART’S, COMM., SCI. & BMS
Presentation transcript:

Portable Support for Transparent Thread Migration in Java Eddy Truyen, Bert Robben, Bart Vanhaute, Tim Coninx, Wouter Jousen and Pierre Verbaeten Department Computerwetenschappen, K.U. Leuven Review by Brian Wims for ECE 7995, WSU 2001

Introduction Mobile Agents Technology –Easier to design and maintain distributed systems –Reduces network traffic –Overcomes network latency –Eventually more robust programs Java as Mobile Agent Platform –Machine independent byte code –Transportable over the net –Transparent migration of data state –Security concepts

Introduction Java’s not “Agent Ready” –Must add Agent capabilities –Middleware support Object semantics Migration mechanisms Resource management Execution support Security …

Introduction –No Strong Mobility Requires transmission of stack, registers Java’s security policy forbids Dynamic inspection of the stack

Problem Statement Java does not support Strong Mobility –Program State –Data State –Execution State –operand stack

Objective Extract Thread state Migrate State Resume Execution

Approach Transform Java Byte Code –Inserted code blocks with JavaClass Capture state Restore state Unique? –Does not alter JVM –Transform prior to execution

Other Approaches Source Code Transformation –Wasp mobile agent Extending the JVM –Sumatra/D`Agents/Ara ByteCode Transformation –run time/preprocessed

Java Thread Overview Java Stack Frame –frame per method call this - pointer local variable 1 local variable 2 partial result 1 partial result 2 obj ref or call method argument value 1 Current Frame Next Frame Current Method Previous Method TopLevel Method call Java Program Objects in program

Other Approaches Source Code Transformation –pre-process the source code Insert checksums –Backup the thread state in Backup Objects –Contains current method –Last checkpoint –State of the local variables –Restoration through partial reexecution –Rebuild Java stack frames –Update local variables 25ms migration time (reexecution) 130x increased execution time factor (extra statements) Source code not always available

Other Approaches Source Code Transformation –Programmer controls migration System.out.println(“bye”); go (“//ritsuko:2001/JavaGoExecutor”);  migration point System.out.println(“nice to meed you”) –Programmer controls “scope” undock { go {“//ritsuko:2001/JavaGoExecutor”); System.out.println(“nice to meet you”); } System.out.println(“bye”)

Other Approaches Source Code Transformation –Preprocessed code restores states void bar( ) { foo( ) System.out.println(“after foo”); return; } void bar( ) { TopLevel: for( ; ; ) switch (entryPoint) { case 0; foo( ); case 1; System.out.println(“after foo”); return; }

Other Approaches Source Code Transformation –Preprocessed code captures local variables void foo ( ) { int x = 0; …. the body of a method } void foo (State_X_foo State) { int x; if (State = null) x=0; else x=State.x; try{ … the body of a method… } catch (NotifyMigration e) { State = new State_x_foo(this); State.x=x; e.Append(State); throw e; }

Other Approaches Extending the JVM ThreadState object –captures thread state –Parses the Java stack (in native c) –Builds Type Stack in parallel –Determines variable types from Java ByteCode »istore, aload, … Restoration initializes new thread to ThreadObject info Public final class ThreadStateMangement{ /* Captures the state of the current thread and returns it as a ThreadObject public static ThreadState capture( ); /* Creates a new Java thread, initializes it with ThreadSt state and starts its exucution public static Thread restore(ThreadState Threadst); } 7 ms thread migration (in JVM) 10x increased execution time factor

Other Approaches Byte Code Transformation (runtime) –“goto” bytecode instruction instead of “Case” source code –uses classLoader to transform bytecode –method in bytecode  transformed method –inserted code fragments exception handler for each method entries from operand stack (copies into local variables) state object passed to each method (extra parameter) restoration instructions begin each method x increased bytecode size 20%-50% increased execution time

Other Approaches Byte Code Transformation Java Class FileClass Loader JavaClass Byte code transformations byte code verifierInterpreter/JIT

Other Approaches Byte Code Transformation class MyClassLoader extends ClassLoader { private directory; public MyClassLoader(String dir) { directory=dir; } public synchronized Class loadClass(String name) { Class c =findLoadedClass(name); if(c!=null) return c; try { c = findSystemClass(name); return c; } catch (ClassNotFoundException e) { // keep looking } try { byte[ ] data = getClassData(directory, name); return defineClass(name, data, 0, data.length( )); …… byte [ ] can come from RMI ByteCode can be transformed before returning

New Approach Byte Code Transformation (preprocessed) –instrument code in advance to reduce execution time –agent initiates migration –captures its own state info uses if statement instead of exception method method { …. a= foo.method( ); if isCapturing( ) { store stackframe into Context store artificial PC (reentry) return; } nextstatement( ); bytecode inserted after return exits method to caller (return vs throw)

New Approach pedict 30% bytecode blowup –affects disk storage 27% increased execution time –with a lot of method calls

Issues  No work on multible threads  How much ByteCode transformation  on java.lang?  No work on external references code blow up, execution time, migration time –no consistent analysis among papers –factors, # methods, type of applications, …