Operating Systems {week 11a}

Slides:



Advertisements
Similar presentations
What is RMI? Remote Method Invocation –A true distributed computing application interface for Java, written to provide easy access to objects existing.
Advertisements

Remote Procedure Call Design issues Implementation RPC programming
©2009 Operačné systémy Procesy. 3.2 ©2009 Operačné systémy Process in Memory.
Tam Vu Remote Procedure Call CISC 879 – Spring 03 Tam Vu March 06, 03.
Copyright © 2001 Qusay H. Mahmoud RMI – Remote Method Invocation Introduction What is RMI? RMI System Architecture How does RMI work? Distributed Garbage.
Sockets  Defined as an “endpoint for communication.”  Concatenation of IP address + port.  Used for server-client communication.  Server waits for.
Chapter 3: Processes. Process Concept Process Scheduling Operations on Processes Cooperating Processes Interprocess Communication Communication in Client-Server.
Advanced Java Class Serialization. Serialization – what and why? What? –Translating the contents of an Object to a series of bytes that represent it,
02/02/2004CSCI 315 Operating Systems Design1 Interprocesses Communication Notice: The slides for this lecture have been largely based on those accompanying.
© Lethbridge/Laganière 2001 Chap. 3: Basing Development on Reusable Technology 1 Let’s get started. Let’s start by selecting an architecture from among.
Communication in Distributed Systems –Part 2
Client-Server Communication Sockets Remote Procedure Calls Remote Method Invocation (Java)
Chapter 3: Processes. 3.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts - 7 th Edition, Feb 7, 2006 Chapter 3: Processes Process Concept.
02/01/2010CSCI 315 Operating Systems Design1 Interprocess Communication Notice: The slides for this lecture have been largely based on those accompanying.
Rensselaer Polytechnic Institute CSCI-4210 – Operating Systems David Goldschmidt, Ph.D.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 12 Communicating over.
Process Concept Process Scheduling Operations on Processes Cooperating Processes Interprocess Communication Communication in Client-Server Systems.
CS 390- Unix Programming Environment CS 390 Unix Programming Environment Topics to be covered: Distributed Computing Fundamentals.
Interprocess Communication: ( ) CPE Operating Systems.
Spring/2002 Distributed Software Engineering C:\unocourses\4350\slides\DefiningThreads 1 RMI.
Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved Chapter 43 Remote Method Invocation.
Distributed Computing A Programmer’s Perspective.
Page 1 Remote Procedure Calls Paul Krzyzanowski Distributed Systems Except as otherwise noted, the content of this presentation.
Hwajung Lee.  Interprocess Communication (IPC) is at the heart of distributed computing.  Processes and Threads  Process is the execution of a program.
Rensselaer Polytechnic Institute CSCI-4210 – Operating Systems David Goldschmidt, Ph.D.
Processes CSCI 4534 Chapter 4. Introduction Early computer systems allowed one program to be executed at a time –The program had complete control of the.
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Lecture 3 Operating Systems.
Remote Procedure Call Andy Wang Operating Systems COP 4610 / CGS 5765.
Mark Stanovich Operating Systems COP Primitives to Build Distributed Applications send and receive Used to synchronize cooperating processes running.
Remote Method Invocation by James Hunt, Joel Dominic, and Adam Mcculloch.
 Process Concept  Process Scheduling  Operations on Processes  Cooperating Processes  Interprocess Communication  Communication in Client-Server.
Remote Method Invocation A Client Server Approach.
1 RMI Russell Johnston Communications II. 2 What is RMI? Remote Method Invocation.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 3: Process-Concept.
Computer Science Lecture 4, page 1 CS677: Distributed OS Last Class: RPCs RPCs make distributed computations look like local computations Issues: –Parameter.
Distributed Computing & Embedded Systems Chapter 4: Remote Method Invocation Dr. Umair Ali Khan.
Liang, Introduction to Java Programming, Fifth Edition, (c) 2005 Pearson Education, Inc. All rights reserved Chapter 29 Remote Method.
Object Interaction: RMI and RPC 1. Overview 2 Distributed applications programming - distributed objects model - RMI, invocation semantics - RPC Products.
Object Interaction: RMI and RPC 1. Overview 2 Distributed applications programming - distributed objects model - RMI, invocation semantics - RPC Products.
RMI (Java RMI) P 460 in text UUIDs / system wide references Transparent: all objects either by ref. or by value. Not efficient, especially int, bool, etc.
Java Distributed Computing
Operating Systems {week 01.b}
Client-Server Communication
03 – Remote invoaction Request-reply RPC RMI Coulouris 5
Object Serialization in Java
Java Distributed Computing
CSE 486/586 Distributed Systems Remote Procedure Call
What is RMI? Remote Method Invocation
Chapter 4: Processes Process Concept Process Scheduling
Processes Overview: Process Concept Process Scheduling
Dave Eckhardt RPC Dave Eckhardt
Knowledge Byte In this section, you will learn about:
Client server programming
CMSC621: Advanced Operating Systems Advanced Operating Systems
Chapter 4: Processes Process Concept Process Scheduling
Lecture 4: RPC Remote Procedure Call Coulouris et al: Chapter 5
Hwajung Lee ITEC452 Distributed Computing Lecture 7 Interprocess Communication (IPC): An Overview.
Sarah Diesburg Operating Systems COP 4610
Hwajung Lee ITEC452 Distributed Computing Lecture 2 Interprocess Communication (IPC): An Overview.
Chapter 40 Remote Method Invocation
Lecture 4: RPC Remote Procedure Call CDK: Chapter 5
Operating System Concepts
EECE.4810/EECE.5730 Operating Systems
Chapter 46 Remote Method Invocation
Chapter 46 Remote Method Invocation
Lecture 6: RPC (exercises/questions)
Lecture 6: RPC (exercises/questions)
Lecture 7: RPC (exercises/questions)
Processes August 10, 2019 OS:Processes.
Presentation transcript:

Operating Systems {week 11a} Rensselaer Polytechnic Institute CSCI-4210 – Operating Systems David Goldschmidt, Ph.D. Operating Systems {week 11a}

Interprocess communication (IPC) Why is it beneficial for an operating system to enable processes to communicate with one another? Share information Cooperation Computational speed-up via parallel programming Modularity of program design Convenience

IPC mechanisms Message Passing Shared Memory both IPC mechanisms require a protocol and synchronization

Client-server communication Processes may communicate on the same machine or across multiple machines Use sockets for interprocess client-server communication Use remote procedure calls (RPCs) to call procedures across a network In Java, use remote method invocation (RMI) to call a method on an object in a different virtual machine

Remote procedure calls (i)

Remote procedure calls (ii) Using RPC, heterogeneous operating systems can interact with one another

Marshaling parameters RPCs can be made across a mix of machines and operating systems All parameters must be marshaled to ensure proper interpretation Consider date representations YYYY-MM-DD or MM-DD-YYYY or DD-MM-YYYY Also consider big endian versus little endian integer representations (see http://en.wikipedia.org/wiki/Endianness)

Remote method invocation RMI is a Java mechanism similar to RPCs RMI enables a running Java program to call a method on a remote object running on a separate Java Virtual Machine this requires object serialization

<ip-address>:<port> Sockets (i) A socket is an endpoint for communication Communication takes place over a pair of sockets <ip-address>:<port> server 128.113.2.9:80 listener socket client 128.113.2.9:9500 socket 66.195.8.34:8123 socket

Sockets (ii) Pitfalls of socket-based communication between client and server include: Once a server binds to a port, no other program may listen on that port If client and server do not obey the rules of the protocol, errors occur

Transmitting objects via sockets In Java, we transmit primitive data types (e.g. int, double) using DataInputStream and DataOutputStream To transmit objects, use ObjectInputStream and ObjectOutputStream instead server client this requires object serialization

Serializing objects (i) Objects exist in a JVM’s memory space To transmit an object over a socket, we must first serialize the object For an object to be serializable, its class definition must implement the java.io.Serializable interface Also useful for saving runtime objects to a file

Serializing objects (ii) The Serializable interface has no methods Simply identifies a class as being serializable And enables the use of readObject() and writeObject() methods of ObjectInputStream and ObjectOutputStream Student object Student object network serialized object writeObject() readObject()

Serializing objects (iii) Classes that are not serializable include: java.lang.Thread java.io.OutputStream java.net.Socket etc. Such classes refer to operating system resources, which are not serializable

Serializing objects (iv) Serialized objects are assigned a unique identifier as a means to version control If you write object X to a socket or file, then modify the source code of class X and recompile the .class file, loading object X results in an InvalidClassException runtime exception All processes must be using the same version