Slide 17-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 17.

Slides:



Advertisements
Similar presentations
Multiple Processor Systems
Advertisements

Slide 19-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 19.
Slide 2-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 2 Using the Operating System 2.
Dr. Kalpakis CMSC 621, Advanced Operating Systems. Fall 2003 URL: Distributed System Architectures.
RPC Robert Grimm New York University Remote Procedure Calls.
Remote Procedure Call (RPC)
Remote Procedure Call Design issues Implementation RPC programming
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Emery Berger University of Massachusetts Amherst Operating Systems CMPSCI 377 Lecture.
Remote Procedure CallCS-4513, D-Term Remote Procedure Call CS-4513 Distributed Computing Systems (Slides include materials from Operating System.
Multiple Processor Systems
Implementing Remote Procedure Calls Andrew Birrell and Bruce Nelson Presented by Kai Cong.
Threads, SMP, and Microkernels Chapter 4. Process Resource ownership - process is allocated a virtual address space to hold the process image Scheduling/execution-
Using DSVM to Implement a Distributed File System Ramon Lawrence Dept. of Computer Science
Distributed Systems Lecture #3: Remote Communication.
Distributed Computing. Distributed Computation Using Files Part 1 Part 2 f1 = open(toPart2, …); while(…){ write(f1. …); } close(f1); … f2 = open(toPart1,
Communication in Distributed Systems –Part 2
Object Based Operating Systems1 Learning Objectives Object Orientation and its benefits Controversy over object based operating systems Object based operating.
PRASHANTHI NARAYAN NETTEM.
Slide 6-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 6.
Distributed Systems Material from Operating System Concepts by Silberschatz et all, 2009 Modern Operating Systems by Tannenbaum and Bos 2015 Operating.
Slide 6-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 6.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Distributed Systems. Interprocess Communication (IPC) Processes are either independent or cooperating – Threads provide a gray area – Cooperating processes.
Threads, Thread management & Resource Management.
Introduction to Distributed Systems Slides for CSCI 3171 Lectures E. W
1 Chapter 2. Communication. STEM-PNU 2 Layered Protocol TCP/IP : de facto standard Our Major Concern Not always 7-layered Protocol But some other protocols.
Communication Tran, Van Hoai Department of Systems & Networking Faculty of Computer Science & Engineering HCMC University of Technology.
Cli/Serv.: rmiCORBA/131 Client/Server Distributed Systems v Objectives –introduce rmi and CORBA , Semester 1, RMI and CORBA.
CS 390- Unix Programming Environment CS 390 Unix Programming Environment Topics to be covered: Distributed Computing Fundamentals.
11 September 2008CIS 340 # 1 Topics To examine the variety of approaches to handle the middle- interaction (continued) 1.RPC-based systems 2.TP monitors.
Introduction to Distributed Systems Slides for CSCI 3171 Lectures E. W. Grundke.
Copyright © George Coulouris, Jean Dollimore, Tim Kindberg This material is made available for private study and for direct.
Slide 3-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3.
1 Lecture 5 (part2) : “Interprocess communication” n reasons for process cooperation n types of message passing n direct and indirect message passing n.
CSE 451: Operating Systems Winter 2015 Module 22 Remote Procedure Call (RPC) Mark Zbikowski Allen Center 476 © 2013 Gribble, Lazowska,
Distributed Computing A Programmer’s Perspective.
Hwajung Lee.  Interprocess Communication (IPC) is at the heart of distributed computing.  Processes and Threads  Process is the execution of a program.
CS 501: Software Engineering Fall 1999 Lecture 12 System Architecture III Distributed Objects.
Remote Procedure Calls CS587x Lecture Department of Computer Science Iowa State University.
Remote Procedure Call RPC
The Mach System Silberschatz et al Presented By Anjana Venkat.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Lecture 4 Mechanisms & Kernel for NOSs. Mechanisms for Network Operating Systems  Network operating systems provide three basic mechanisms that support.
Computer Science Lecture 3, page 1 CS677: Distributed OS Last Class: Communication in Distributed Systems Structured or unstructured? Addressing? Blocking/non-blocking?
Introduction Contain two or more CPU share common memory and peripherals. Provide greater system throughput. Multiple processor executing simultaneous.
1 Chapter 2. Communication. STEMPusan National University STEM-PNU 2 Layered Protocol TCP/IP : de facto standard Our Major Concern Not always 7-layered.
Implementing Remote Procedure Call Landon Cox February 12, 2016.
© Oxford University Press 2011 DISTRIBUTED COMPUTING Sunita Mahajan Sunita Mahajan, Principal, Institute of Computer Science, MET League of Colleges, Mumbai.
Computer Science Lecture 4, page 1 CS677: Distributed OS Last Class: RPCs RPCs make distributed computations look like local computations Issues: –Parameter.
Introduction to Distributed Systems Slides for CSCI 3171 Lectures E. W. Grundke.
Distributed Systems Material from Operating System Concepts by Silberschatz et all, 2009 Modern Operating Systems by Tannenbaum and Bos 2015 Operating.
03 – Remote invoaction Request-reply RPC RMI Coulouris 5
File System Implementation
Dave Eckhardt RPC Dave Eckhardt
Ch > 28.4.
CSE 451: Operating Systems Winter 2006 Module 20 Remote Procedure Call (RPC) Ed Lazowska Allen Center
DISTRIBUTED COMPUTING
CSE 451: Operating Systems Autumn 2003 Lecture 16 RPC
Multiple Processor Systems
CSE 451: Operating Systems Winter 2007 Module 20 Remote Procedure Call (RPC) Ed Lazowska Allen Center
Lecture 4: RPC Remote Procedure Call CDK: Chapter 5
CSE 451: Operating Systems Winter 2004 Module 19 Remote Procedure Call (RPC) Ed Lazowska Allen Center
CSE 451: Operating Systems Spring 2012 Module 22 Remote Procedure Call (RPC) Ed Lazowska Allen Center
CSE 451: Operating Systems Autumn 2009 Module 21 Remote Procedure Call (RPC) Ed Lazowska Allen Center
Chapter 15: File System Internals
Operating Systems: A Modern Perspective, Chapter 6
CSE 451: Operating Systems Autumn 2010 Module 21 Remote Procedure Call (RPC) Ed Lazowska Allen Center
CSE 451: Operating Systems Winter 2003 Lecture 16 RPC
Last Class: Communication in Distributed Systems
CSE 451: Operating Systems Messaging and Remote Procedure Call (RPC)
Presentation transcript:

Slide 17-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 17

Slide 17-2 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter Distributed Computing

Slide 17-3 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 17 Distributed Computation Using Files Part 1 Part 2 f1 = open(toPart2, …); while(…){ write(f1. …); } close(f1); … f2 = open(toPart1, …); while(…){ write(f2. …); } close(f2); f2 = open(toPart2, …); while(…){ read(f1, …); } close(f1); f2 = open(toPart1, …); while(…){ read(f2, …); } close(f2);

Slide 17-4 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 17 Finer Grained Sharing Distributed computing can be for: –Speed up (simultaneous execution) –Simplify data management (consistency) Last Generation: programming languages (and programmers) do serial computation –Want to share global data –Speed up is a specialist’s domain Procedure is basic unit of abstraction –Abstract data type behavior

Slide 17-5 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 17 Finer Grained Sharing (2) Newer computing model –Partition into processes/threads –Message passing communication New OS & language support –Remote procedures –Remote objects with remote method invocation –Distributed process management –Shared memory –Distributed virtual memory … but first, how to partition the computations?

Slide 17-6 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 17 Data Partition Serial Form of code while(…){…} Distribute Data Serial Form Execute all data streams simultaneously

Slide 17-7 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 17 Functional Partition Serial Form of code A Partition The Parts

Slide 17-8 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 17 Functional Partition (2) Software is composed from procedures All programmers are familiar with procedural abstraction – exploit procedure model Allow each function to be a blob Implement each blob as a thread/process OS provide network IPC mechanism for serial use of distributed functions –TCP/IP –Messages –“Procedure call” protocol between client and server

Slide 17-9 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 17 Record Sharing Part 1 Part 2 … while(…){ writeSharedRecord(…); readSharedRecord(…); } … while(…){ readSharedRecord(…); writeSharedRecord(…); } …

Slide Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 17 Traditional Memory Interfaces Process Virtual Memory Virtual Memory File Management File Management Physical Memory Physical Memory Storage Devices Storage Devices Device Interface Secondary Memory InterfacePrimary Memory Interface

Slide Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 17 Exploiting Normal Interfaces to the Memory System Process Virtual Memory Virtual Memory File Management File Management Physical Memory Physical Memory Storage Devices Storage Devices File System InterfacePrimary Memory Interface Remote Disk Client Remote Disk Client Remote Disk Server Remote Disk Server Remote File Client Remote File Client Remote File Server Remote File Server Privileged Use Only

Slide Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 17 Remote Memory Process File Management File Management Remote Memory Interface Remote Memory Client Remote Memory Client Remote Memory Server Remote Memory Server Static memory  New language Dynamic memory  New OS interface Low level interface Binding across address spaces Shared memory malloc High level interface Tuples Objects

Slide Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 17 Distributed Virtual Memory Process Virtual Memory Virtual Memory Physical Memory Physical Memory Storage Devices Storage Devices Primary Memory Interface Remote Paging Client Remote Paging Client Remote Paging Server Remote Paging Server Storage Devices Storage Devices

Slide Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 17 Distributed Virtual Memory(2) Process 1 Primary Memory Space Primary Memory Space Local Secondary Memory Local Secondary Memory Virtual Address Space map Remote Secondary Memory Remote Secondary Memory Server Process 2 Primary Memory Space Primary Memory Space Local Secondary Memory Local Secondary Memory Virtual Address Space map

Slide Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 17 Remote Procedure Call int main(…) { … func(a1, a2, …, an); … } void func(p1, p2, …, pn) { … } int main(…) { … func(a1, a2, …, an); … } void func(p1, p2, …, pn) { … } Conventional Procedure Call Remote Procedure Call

Slide Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 17 Remote Procedure Call int main(…) { … func(a1, a2, …, an); … } void func(p1, p2, …, pn) { … } … pack(a1, msg); pack(a2, msg); … pack(an, msg); send(rpcServer, msg); // waiting... result = receive(rpcServer);... // Initialize the server while(TRUE) { msg = receive(anyClient); unpack(msg, t1); unpack(msg, t2); … unpack(msg, tn); func(t1, t2, …, tn); pack(a1, rtnMsg); pack(a2, rtnMsg); … pack(an, rtnMsg); send(rpcServer, rtnMsg); }

Slide Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 17 Implementing RPC Syntax of an RPC should look as much like a local procedure call as possible Semantics are impossible to duplicate, but they should also be as close as possible The remote procedure’s execution environment will not be the same as a local procedure’s environment –Global variables –Call-by-reference –Side effects –Environment variables

Slide Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 17 Implementing RPC int main(…) { … localF(…); … remoteF(…); … } void localF(…) { … return; } lookup(remote); pack(…); send(rpcServer, msg); receive(rpcServer); unpack(…); return; register(remoteF); while(1) { receive(msg); unpack(msg); remoteF(…); pack(rtnMsg); send(theClient,rtnMsg); } clientStub main theClient void remoteF(…) { … return; } void register(…) { … } void lookup(…) { … } Name Server rpcServer First Time Only

Slide Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 17 Compiling an RPC callRemote(remoteF, …); remoteF(…); –Compile time –Link time –Dynamic binding

Slide Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 17 Sun XDR Conversion Client RPC Server XDR conversion XDR conversion XDR Spec XDR conversion XDR conversion Network XDR Transmit

Slide Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 17 Sun rpcgen Files main.c rproc.x rproc_clnt.c rproc.h rproc_svc.c rproc.c rpcgen C compiler RPC client RPC server

Slide Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 17 Distributed Object Interface Process Object Interface Remote Object Client Remote Object Client Remote Object Server Remote Object Server Local Objects Process Remote Object Interface Remote Object Client Remote Object Client Remote Object Server Remote Object Server Local Objects Local Object Interface Performance e.g. Corba, DCOM, SOAP, … (a) Single Interface to Objects (b) Interface to Local and Remote Objects

Slide Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 17 IDL Skeleton The CORBA Approach Client Object Implementation Object Implementation ORB Interface ORB Core IDL Stub Stub Implement IDL Skeleton Dynamic Skel. Dynamic Skel Dynamic Stub Dynamic Stub. Object Adaptor Interface Repository

Slide Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 17 Supporting the Computation Each blob might be a process, thread, or object Blobs should be able to run on distinct, interconnected machines OS must provide mechanisms for: –Process Management Control Scheduling Synchronization IPC –Memory Management Shared memory –File Management – remote files Distributed OS or cooperating Network OSes?

Slide Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 17 Control Remote process/thread create/destroy Managing descriptors Deadlock

Slide Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 17 Scheduling Threads and processes Explicit scheduling Transparent scheduling Migration & load balancing Objects –Active vs passive –Address spaces

Slide Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 17 Migration and Load Balancing p p A thread or process Machine A Machine B Machine C p p p p p p p p p p p Machine A Machine B Machine C p p p p p p p p p p (a) Before Balancing(b) After Balancing

Slide Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 17 Synchronization Distributed synchronization –No shared memory  no semaphores –New approaches use logical clocks & event ordering Transactions –Became a mature technology in DBMS –Multiple operations with a commit or abort Concurrency control –Two-phase locking

Slide Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 17 Updating a Multiple Field Record Process piProcess pj... send(server, update, k, 3);send(server, update, k, 5); send(server, update, k, 6);send(server, update, k, 8); send(server, update, k, 2);send(server, update, k, 4); send(server, update, k, 8);send(server, update, k, 6);...

Slide Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 17 Explicit Event Ordering Alternative technique of growing importance in network systems Rely on knowing the relative order of occurrence of every event –(occurrence of y in p j ) < (occurrence of x in p i ) –Then can synchronize by explicitly specifying each relation (when it is important) advance(eventCount): Announces the occurrence of an event related to eventCount, causing it to be incremented by 1 await(eventCount, v): Causes process to block as long as eventCount < v.

Slide Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 17 Producer-Consumer Solution Using Precedence producer() {consumer() {/* i establishes local order */ int i = 1; while(TRUE) { /* Stay N–1 ahead of consumer */ /* Stay N–1 behind producer */ await(out, i-N); await(in, i); produce(buffer[(i–1) mod N]); consume(buffer[(I–1) mod N]; /* Signal a full buffer */ /* Signal an empty buffer */ advance(in); advance(out); i = i+1; }} eventcount in=0, out=0; struct buffer[N]; fork(producer, 0); fork(consumer, 0);

Slide Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 17 More on EventCounts Notice that advance and await need not be uninterruptible There is no requirement for shared memory For full use of this mechanism, actually need to extend it a bit with a sequencer Underlying theory is also used to implement “virtual global clocks” in a network Emerging as a preferred synchronization mechanism on networks