Multitasking JVMs Isolates and KaffeOS Presentation by James Rose.

Slides:



Advertisements
Similar presentations
Threads, SMP, and Microkernels
Advertisements

COS 461 Fall 1997 Network Objects u first good implementation: DEC SRC Network Objects for Modula-3 u recent implementation: Java RMI (Remote Method Invocation)
1 Chapter 5 Threads 2 Contents  Overview  Benefits  User and Kernel Threads  Multithreading Models  Solaris 2 Threads  Java Threads.
Copyright © 2001 Qusay H. Mahmoud RMI – Remote Method Invocation Introduction What is RMI? RMI System Architecture How does RMI work? Distributed Garbage.
The road to reliable, autonomous distributed systems
Client Side Programming Using Java Applet Outcomes: You will be expected to know: – Java Applets and HTML file; –bytecode and platform independent programs;
Day 10 Threads. Threads and Processes  Process is seen as two entities Unit of resource allocation (process or task) Unit of dispatch or scheduling (thread.
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.
The Alta Operating System Patrick Tullmann Masters Thesis Defense University of Utah.
Threads 1 CS502 Spring 2006 Threads CS-502 Spring 2006.
1 Janos Patrick Tullmann Flux Research Group University of Utah.
1 Chapter 4 Threads Threads: Resource ownership and execution.
Threads. Processes and Threads  Two characteristics of “processes” as considered so far: Unit of resource allocation Unit of dispatch  Characteristics.
Multithreading in Java Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
User-Level Interprocess Communication for Shared Memory Multiprocessors Brian N. Bershad, Thomas E. Anderson, Edward D. Lazowska, and Henry M. Levy Presented.
6/4/98SIGMOD'98 -- Cornell Predator Project1 Secure and Portable Database Extensibility Tobias Mayr Michael Godfrey Praveen Seshadri Thorsten von Eicken.
Processes CS 416: Operating Systems Design, Spring 2001 Department of Computer Science Rutgers University
School of ComputingJanos Project Processes in KaffeOS: Isolation, Resource Management, and Sharing in Java Godmar Back Wilson HsiehJay Lepreau School of.
KaffeOS: Controlling Resources In A Multi-Process Java Virtual Machine Godmar Back.
CS533 Concepts of Operating Systems Class 9 Lightweight Remote Procedure Call (LRPC) Rizal Arryadi.
Introduction to Java CSIS 3701: Advanced Object Oriented Programming.
9/13/20151 Threads ICS 240: Operating Systems –William Albritton Information and Computer Sciences Department at Leeward Community College –Original slides.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 12 Communicating over.
Jaeki Song ISQS6337 JAVA Lecture 16 Other Issues in Java.
1 Lecture 4: Threads Operating System Fall Contents Overview: Processes & Threads Benefits of Threads Thread State and Operations User Thread.
Introduction to Java CSIS 3701: Advanced Object Oriented Programming.
Threaded Applications Introducing additional threads in a Delphi application is easy.
Multi-Threaded Application CSNB534 Asma Shakil. Overview Software applications employ a strategy called multi- threaded programming to split tasks into.
February 24, 1998Salt Lake Java SIG Processes In Java Patrick Tullmann Flux Research Group University of Utah.
Java 2 security model Valentina Casola. Components of Java the development environment –development lifecycle –Java language features –class files and.
In the name of Allah The Proxy Pattern Elham moazzen.
1 Web Based Programming Section 8 James King 12 August 2003.
Spring/2002 Distributed Software Engineering C:\unocourses\4350\slides\DefiningThreads 1 RMI.
Nested Java Processes: OS Structure for Mobile Code Patrick Tullmann & Jay Lepreau September 10, 1998 Flux Project University of Utah
Processes Introduction to Operating Systems: Module 3.
Multithreading in Java Sameer Singh Chauhan Lecturer, I. T. Dept., SVIT, Vasad.
Introduction to Threads Session 01 Java Simplified / Session 14 / 2 of 28 Objectives Define a thread Define multithreading List benefits of multithreading.
1 A Secure Access Control Mechanism against Internet Crackers Kenichi Kourai* Shigeru Chiba** *University of Tokyo **University of Tsukuba.
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
Concurrency Control 1 Fall 2014 CS7020: Game Design and Development.
Networking Implementations (part 1) CPS210 Spring 2006.
Operating Systems CSE 411 CPU Management Sept Lecture 10 Instructor: Bhuvan Urgaonkar.
Department of Computer Science and Software Engineering
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 4: Threads.
Processes and Virtual Memory
CSI 3125, Preliminaries, page 1 SERVLET. CSI 3125, Preliminaries, page 2 SERVLET A servlet is a server-side software program, written in Java code, that.
Remote Method Invocation by James Hunt, Joel Dominic, and Adam Mcculloch.
Java Distributed Object Model A remote object is one whose methods can be invoked from another JVM on a different host. It implements one or more remote.
Distributed programming in Java Faculty:Nguyen Ngoc Tu Session 5 - RMI.
Implementing Remote Procedure Call Landon Cox February 12, 2016.
Computer Science Lecture 4, page 1 CS677: Distributed OS Last Class: RPCs RPCs make distributed computations look like local computations Issues: –Parameter.
Chapter three.  An operating system executes a variety of programs:  A batch system executes jobs.  A time-shared systems has user programs or tasks.
Client-Server Communication
Multitasking without Compromise: a Virtual Machine Evolution
Processes and threads.
Memory Protection: Kernel and User Address Spaces
Chapter 2 Processes and Threads Today 2.1 Processes 2.2 Threads
Operating System (013022) Dr. H. Iwidat
Process Management Presented By Aditya Gupta Assistant Professor
KERNEL ARCHITECTURE.
Chapter 4: Threads.
Memory Protection: Kernel and User Address Spaces
Memory Protection: Kernel and User Address Spaces
Memory Protection: Kernel and User Address Spaces
Thread Implementation Issues
Threads and Concurrency
Java Remote Method Invocation
Chapter 4: Threads.
Memory Protection: Kernel and User Address Spaces
Presentation transcript:

Multitasking JVMs Isolates and KaffeOS Presentation by James Rose

Multitasking in Java We want to share the virtual machine Share bytecode Share JIT-compiled native code Start JVM once Efficient IPC

Naïve approach Create a thread for each task Hope for the best!

Problems with Sharing No way to enforce separation No accounting for resources No way to safely terminate processes

Approaches Code-to-code translation Modified JVM Approach taken by Kaffe, MVM

Sharing in KaffeOS Per-process heap and namespace Shared heaps for communication between processes Common shared.* namespace for all shared objects

KaffeOS Memory Structure  No pointers to user heaps except from kernel

Separation in KaffeOS Write barrier prevents illegal references Shared code can’t keep user objects alive All heaps have independent GC Cross-heap references tracked by reference counting

Termination in KaffeOS User/kernel separation allows safe termination Termination deferred inside kernel code Shared objects are always on top of call stack: malicious code can be terminated without harm to system

Accounting in KaffeOS Memory accounting includes allocations within the VM for a process Independent GC improves accuracy Shared heaps charged to all sharers Precise resource accounting prevents denial-of-service attacks

JSR-121: Isolates and MVM Defines Isolate class Defines a simple mechanism for passing messages MVM: HotSpot + JSR-121

MVM is not an OS No resource accounting

Cross-Isolate Method Invocation Or XIMI, for short Stripped-down version of RMI Isolates can call methods on stubs of objects in other Isolates Stubs are generated by the VM dynamically (no rmic )

Portals XIMI equivalent of RMI’s RemoteObject Objects are wrapped in Portals and passed to clients public abstract class Portal { static public Portal newPortal( Class interface, Object target, boolean copyable); //... }

Invoking Methods on Portals A method call spawns a new thread in the server… Or blocks until the server calls accept() Arguments to the method are “serialized” Not really, that’s slow Method calls may fail if server dies What happens then?

Heap Structure Generational GC: Shared old generation, per-isolate new generation XIReference : weak reference held only by stubs

Heap Structure XIReference XIMIStub$Map Portal HashMap Isolate A Isolate B old space Map nameserv new spaces

KaffeOS MVM Write barriers enforce isolation on shared objects Methods invoked directly Write barriers slow down all programs Objects or stubs are copied between isolates Methods execute in the owning isolate Resource accounting tricky

Applications Java shell Java daemon Dynamic web server Web browser Which model fits these applications better?

Web Server Natural way to code it: interface WebRequest { String getPath(); String getHostname(); String getHTTPVersion(); void println (String out); } interface Servlet { void run (WebRequest w); }

WebServer in KaffeOS WebRequest must be in shared.* But now WebRequest can’t do anything with WebServer ! The paper does not define a communication mechanism, only a sharing mechanism

WebServer in MVM/XIMI class WebServer { public void answerQuery(Socket s) { //..make WebRequest object.. port = Portal.newPortal( WebRequest, curRequest, false); new Isolate(appletName).start (port); }

XIMI WebServer Execution applet server getprint get print

This is stupid… Switching contexts like this is silly and slow But a coarse-grained interface is inconvenient for many applications RMI makes more sense between machines than within machines

MVM Structure Shared Code Heap Isolate 1 Isolate 2 XIMI